Global Hook on IR control
-
Hi, I used the tutor from microsoft to get messages from my IR Control (link). The code works fine, but when the window loses focus, it doesn't work anymore. I need this code to work also when the program doesn't have focus (global hook?). Thanks in advance.
-
Hi, I used the tutor from microsoft to get messages from my IR Control (link). The code works fine, but when the window loses focus, it doesn't work anymore. I need this code to work also when the program doesn't have focus (global hook?). Thanks in advance.
From the little that I've seen about this, the remote works by using keyboard emulation. About half of the remote's keys are sent to the application using WM_INPUT and WM_KEYDOWN messages. This makes it easy to use, but when the focus changes, the "keystrokes" are now going to another application. This presents a problem. Since the message from the remote are exactly like normal keyboard messages, there's no way to tell them apart. You COULD put together a low level keyboard hook, but there's no way to tell if the keystrokes you're seeing are coming from the real keyboard or from the remote. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
From the little that I've seen about this, the remote works by using keyboard emulation. About half of the remote's keys are sent to the application using WM_INPUT and WM_KEYDOWN messages. This makes it easy to use, but when the focus changes, the "keystrokes" are now going to another application. This presents a problem. Since the message from the remote are exactly like normal keyboard messages, there's no way to tell them apart. You COULD put together a low level keyboard hook, but there's no way to tell if the keystrokes you're seeing are coming from the real keyboard or from the remote. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome