capture wm_char message
-
I have a CFormview based SDI application. On the formview, I have a property sheet displayed, which has quite some edit controls. Although I have specified accelerator keys in the resource, the program never respond to any key press. So I am thinking of CMyView::PreTranslateMessage, then CMyView::WindowProc, but neither of them can capture wm_char message when I pressed any key when the edit control on property page is having the input focus. what can I do? Thanks a lot!
-
I have a CFormview based SDI application. On the formview, I have a property sheet displayed, which has quite some edit controls. Although I have specified accelerator keys in the resource, the program never respond to any key press. So I am thinking of CMyView::PreTranslateMessage, then CMyView::WindowProc, but neither of them can capture wm_char message when I pressed any key when the edit control on property page is having the input focus. what can I do? Thanks a lot!
It's just a guess, i don't use the MFC framework, but don't the WM_CHAR messages only get sent to the actual edit window? Try using GetWindow() to get the handle of the edit control, and then run a loop using GetMessage() to get the first message in the message queu. Then check it for WM_CHAR and ... It's just a guess though, there's probably an easier way :-D Kuniva --------------------------------------------
-
It's just a guess, i don't use the MFC framework, but don't the WM_CHAR messages only get sent to the actual edit window? Try using GetWindow() to get the handle of the edit control, and then run a loop using GetMessage() to get the first message in the message queu. Then check it for WM_CHAR and ... It's just a guess though, there's probably an easier way :-D Kuniva --------------------------------------------
I am not sure. But in one article Nish wrote, you can use PreTranslateMessage to capture wm_keydown or other messages by the dialog instead of having it processed by the control which have the input focus. I think I should be able to do the same in my app. but :(( The GetWindow() would be a messy one in my case even it works, since I have hundreds of edit controls. any other hint?:confused: