Click to See Complete Forum and Search --> : Catching keyboard messages globally


April 8th, 1999, 02:29 PM
How do I go about catching keyboard messages (WM_KEYDOWN, etc.) for the entire screen, not just my app's window? Thanks in advance,

Don McGee
EUSDHM@am1.ericsson.se

Daniel Levine
April 8th, 1999, 05:14 PM
Hi,

To catch a message globally, you have to install a hook procedure. In order for the hook to be system wide, the hook callback function itself has to be contained in a DLL. To catch all messages, use SetWindowsHookEx with the hook type as WM_CALLWNDPROC. If you only want to catch a specific type of message, there are other constants to suit your needs. You should check the documentation for full details.

Daniel.