Button doesn't recieve WM_KEYDOWN for VK_RETURN
Posted on 2008-06-18
I have a window (non-dialog) and some buttons.
When I start the application, the focus is on one of the buttons, however enter doesn't click the button, unless I first move around for example tab to another button then press enter to click that one, or even tab back to the original and it will work this time.
I've investigated what happens. The button does in fact recieve the WM_KEYDOWN for VK_RETURN, I've looked for it in Spy++, but the button's wndproc does not.
Even after I tab around, the button's wndproc still doesn't recieve it, but this time the parent gets the BN_CLICKED notification.
I'm looking for a way to get the WM_KEYDOWN for VK_RETURN, or at least a way to have the parent get the BN_CLICKED initially.