Trapping and Sending Keypresses
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Trapping and Sending Keypresses

  1. #1
    Join Date
    May 2004
    Posts
    1

    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.
    Thanks

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

    NICK.

    E-MAIL : codeguru_bank@yahoo.com

  3. #3
    Join Date
    Jul 2003
    Location
    Korea
    Posts
    60
    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.
    Quang

  4. #4
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652
    Take a look at the following article...
    Ciao, Andreas

    "Software is like sex, it's better when it's free." - Linus Torvalds


    Article(s): Allocators (STL) Function Objects (STL)

Posting Permissions

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


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center