How to catch an ESC KeyPress using WndProc?
+4
A:
Why are you doing it this way? Why not set the PreviewKey
property of the Form to true
and set a global event handler for KeyUp
and check it...
if (e.KeyCode == Keys.Esc){ //... }
tommieb75
2010-03-21 13:41:48
This won't work with certain keys, but it seems to work fine with the escape key. BTW, I believe it's KeyPreview.
Snarfblam
2010-03-21 14:00:50
Sank's, I already do that. I'm just searching for alternative way )
Pritorian
2010-03-21 14:35:39
A:
(msg==WM_KEYDOWN) && (wParam==VK_ESCAPE) ... ops it was c#... sorry , that is win32 api way
luca
2010-03-21 13:55:45