CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    13

    Focus and Capturing Keystrokes

    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

  2. #2
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Focus and Capturing Keystrokes

    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


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured