I have put a pushbutton on an ordinary window as a child. I can click it with the mouse and my code reacts correctly.
I.E. in the WndProc procedure
mov eax, wParam
shr eax, 16
.if (ax == BN_CLICKED)

However, if I add BS_DEFPUSHBUTTON to it's style, the button gets the dark border like it should, but I dont get a BN_CLICKED when I depress the enter key.
Any guesses?
Posted on 2002-03-03 10:51:19 by sceptor
If you are using a DialogBox, the inbehind windows code automactically translates the keypress, which is a WM_CHAR message to sending the button a BM_CLICK message which in return gives you a BN_CLICKED message back.

If using an ordinary window, you have to do this processing yourself (unless you can figure out a way to get DefWindowProc or similer to do it for you)
Posted on 2002-03-03 13:25:47 by huh
Thanks for the help. As soon as I started looking for WM_CHAR, and started sending BN_CLICKED, it works like I wanted.
Posted on 2002-03-03 13:59:40 by sceptor
hey... thanks too... i was wondering about this also some time ago.
Posted on 2002-03-03 14:11:18 by JimmyClif