Hi,
Does somebody know how to capture the Enter key?
In my Visual c++ 5.0 program, i use the WM_KEYDOWN to capture the key press, I can capture most of the keys, like F1,F2,A,B,C....but Enter and Esc and a few others I can not. help please.
thanks
Printable View
Hi,
Does somebody know how to capture the Enter key?
In my Visual c++ 5.0 program, i use the WM_KEYDOWN to capture the key press, I can capture most of the keys, like F1,F2,A,B,C....but Enter and Esc and a few others I can not. help please.
thanks
esc = Ascii code 27.
enter/return = Ascii code 13.
yes, I know the key value. My problem is that when I hit the Enter or Esc key, the program does not go to the WM_KEYDOWN function.
That's because they're already captured for things like the default button. Are you using a dialogue rather than a raw window?
Yes, I am using CBitmapDialog, which is based on CDialog.
I do not have any butttons on it, just some static lables. If the Enter and Esc are captured by default, where? and how can I change the default setting? Thanks.
In MFC you can probably override the PreTranslateMessage function. In WinAPI I believe it to be impossible with normal dialogs (it may be impossible with the common dialogs in MFC too).
yes, you are right. I do need override the PreTranslateMessage function. It works OK now.
Thanks again,guys.;)