CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    Catching keyboard messages globally

    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
    [email protected]


  2. #2
    Join Date
    May 1999
    Posts
    31

    Re: Catching keyboard messages globally

    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured