December 8th, 2003, 07:13 AM
MFC: How do I receive WM_KEYDOWN message in a complicated dialog
My dialog box has many different controls - buttons, list-boxes, radios etc. (but no edit controls). It is designed to be part of a hand-held device simulator (it looks like a calculator).
I have added ON_WM_KEYDOWN to my dialog's message map but all key messages are intercepted by the controls long before my dialog can deal with them.
Other than sub-classing all of these different control classes then adding ON_WM_KEYDOWN to each of their seperate message maps, is there a better way of capturing key messages?
In other words, how can I make it so that when the '6' key on my PC is pressed, my OnKeyDown method can deal with it, and when it is released, my OnKeyUp method is informed?
Many thanks for your potential help.
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.