logoalt Hacker News

iamcalledrobtoday at 11:55 AM1 replyview on HN

> But there is an issue with Win32 API programming. And the truth is that custom windows mean doing everything yourself, controlling every Windows message, and that is fragile

This isn't actually true though. You can delegate to the default window proc, and only customise what you want.

Sure, if your window is now a triangle, you need to think about how resizing is going to work. But you don't need to re-implement everything from scratch -- only the defaults that aren't compatible with your new design.


Replies

sumtechguytoday at 12:42 PM

> This isn't actually true though. You can delegate to the default window proc, and only customise what you want.

Yeah that was my memory of doing this stuff. You basically just added what you wanted to the case statement (or other hooks depending on your framework). Then dump the rest onto the default proc. The default 'wizards' usually made the standard petzold structure for you and you didnt even really have to think much about it. Now if you were doing everything by yourself just make sure you read the docs and make sure you call the default in the right cases.