Click to See Complete Forum and Search --> : Focus and Capturing Keystrokes


Talking
May 28th, 1999, 01:08 PM
I have a small VB 5 app. I want it to intercept key presses (like normal typing) in another app like Word (so they still appear in Word) when my app doesn't have the focus. My app will act on certain keys or key combinations. Most of the keyup and keydown stuff seems to need my app to have the focus. I could do this with activate "xxx" except that my app does not have a title in its title bar window (it's too small).

Voice Recognition, Microphones, and Text-To-Speech.
Products, Support, and International Sales.
www.talking.co.uk

Ravi Kiran
May 31st, 1999, 04:05 AM
You can write a keyboard 'Hook' procedure to capture the keyboard event before it is sent (to the app that it has focus). Windows supports this kind of hooking into the message chain.

Take a look at SetWindowsHookEx function in MSDN.

( But getting it to work in VB may a difficult thing?!). My advice: First try with a 'C' dll and then go for VB!!

Ravi