May 14th, 2004, 08:03 PM
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.
May 14th, 2004, 08:12 PM
Look for System wide Keyboard hook ., which may help you to solve your problem.!
May 14th, 2004, 08:15 PM
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.
May 15th, 2004, 04:58 AM
Take a look at the following article...
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!