On Sun Mar 24 03:09:06 2024 +0000, Alistair Leslie-Hughes wrote:
I attempted to use a subclass however it just end up drawing badly and the dialog didn't get the key press message. Not sure, what I missed though. Do dialogs box actually get a key press message?
I'm not sure why subclassing broke things, but I suppose it's not enough by itself, since the problem (which I didn't realize) is that keyboard messages are going to the individual controls, not the parent dialog window.
Still, a message hook seems like an ugly solution. One possibly better one is to use a modeless dialog and a custom message loop, and catch WM_KEYDOWN messages in the message loop.