Handling of ESCAPE and RETURN
-
I want to handle the ESCAPE key in certain situation; I try to catch it in PreTranslateMessage with WM_KEYUP. Pressing ESCAPE leads always to the "cancel" result. If I have a control named IDCANCEL, the OnClicked handler receives the control, whenever ESACPE has been pressed, but I can not differentiate between clicking on that control and the "true ESCAPE". Is there a way I can separate the "escape" key from the CANCEL button and from "exit" ("X" in the system menu)? Actually, I need it in a CEdit control.
-
I want to handle the ESCAPE key in certain situation; I try to catch it in PreTranslateMessage with WM_KEYUP. Pressing ESCAPE leads always to the "cancel" result. If I have a control named IDCANCEL, the OnClicked handler receives the control, whenever ESACPE has been pressed, but I can not differentiate between clicking on that control and the "true ESCAPE". Is there a way I can separate the "escape" key from the CANCEL button and from "exit" ("X" in the system menu)? Actually, I need it in a CEdit control.
Refer this[^]. Similarly, use
VK_RETURN
for enter key.Prasad Notifier using ATL | Operator new[],delete[][^]
-
I want to handle the ESCAPE key in certain situation; I try to catch it in PreTranslateMessage with WM_KEYUP. Pressing ESCAPE leads always to the "cancel" result. If I have a control named IDCANCEL, the OnClicked handler receives the control, whenever ESACPE has been pressed, but I can not differentiate between clicking on that control and the "true ESCAPE". Is there a way I can separate the "escape" key from the CANCEL button and from "exit" ("X" in the system menu)? Actually, I need it in a CEdit control.
-
Refer this[^]. Similarly, use
VK_RETURN
for enter key.Prasad Notifier using ATL | Operator new[],delete[][^]