how to respond to keyboard message in the dialog application
-
I build a dialog application using VC++, and I want to deal with the keyboard message. but the ON_KeyDown fuction can't work, it can't be called by framework at all. then I find that I can deal with keyboard message in the PreTranslateMessage function, but it just like odd. I think it must have a better method. thanks laia
-
I build a dialog application using VC++, and I want to deal with the keyboard message. but the ON_KeyDown fuction can't work, it can't be called by framework at all. then I find that I can deal with keyboard message in the PreTranslateMessage function, but it just like odd. I think it must have a better method. thanks laia
KEYDOWN works with dialogs. You can try it with an epty dialog (no controls on it, not even OK and Cancel) and see the function gets called. But if you place any controls on the dialog the messege doesn't get sent to the dialog no more, it gets sent to a control on the dialog. That's why your function doesn't get called. PreTranslateMessage works fine, I don't think it's odd. But if you find a better way please share ;). johnnyl