CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2004

    Trapping and Sending Keypresses

    Hello, I've recently found interest in trapping and sending keypresses. I have been unable to locate the information that is specific to my problem. I did numerous forum searches, read through articles, and searched other websites. I'm trying to detect a keypress in MFC while not focusing the application that is detecting it. I'm trying to give the application a "hotkey" which I need to be able to activate without focus. If anyone can point me in the right direction with a tutorial or anything, it would be much appreciated.

  2. #2
    Join Date
    Jul 2002
    Princeton, NewJersey, US
    Look for System wide Keyboard hook ., which may help you to solve your problem.!
    GOOD DAY..!


    E-MAIL : codeguru_bank@yahoo.com

  3. #3
    Join Date
    Jul 2003
    It is the way some programs such as Unikey, or IME do. If you want to capture all keypress of the system, you have to use hooking API. Besides you can also detect mouse events. When you use function to hook event, every mentioned events are sent to your own function. Then you forward events to the system if you want. Many others program may use these events. So it is better off forwarding all events you received. Please read MSDN for details. It is just I heard about that. I have never done it before.

  4. #4
    Join Date
    May 2000
    KY, USA
    Take a look at the following article...

Posting Permissions

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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.