Link to home
Start Free TrialLog in
Avatar of RivKin
RivKin

asked on

cathing key events

Hello,
I have an MFC application that contains many forms/tabs etc.
I want to catch all keys pressed in my application in a single function.
how can I do that?
I tried overriding the PreTranslateMessage in my MainFrame but it doesn't catch every event (e.g. when the tab heading has the focus).

Thanks,
RivKin
SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Priyesh
Priyesh

Read about CWinApp::ProcessMessageFilter(). Might be of help in this case
>>Roshon
I think what you have given is message hook not keyboard hook, isn't it?

Yes ;-)

But this handles only keyboard messages for PreTranslateMessage.

Rosh
>>As jkr says

So, why repeating it?