EV_WM_KEYDOWN

I am using the Borland C++ 4.5 compiler with ObjectWindows.
I have created a Window with the class TFrameWindow, with
a number if buttons (TButton class) and edit fields (TEdit class). I want to create an event handler that will be
run every time the users presses the escape key. This
event handler should be run even if a button or a edit
field has got the focus. I have tried using an event
handler for the EV_WM_KEYDOWN message for the TFrameWindow, but this seems to be working only when none of the controls have got the focus.
ruwAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
costyaConnect With a Mentor Commented:
Override the PreprocessMsg function in your window class - it receives input messages before any child windows so you can catch the WM_KEYDOWN there.

Hope this will help.
Costya.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.