Results 1 to 7 of 7

Thread: Catching Keyboard Activity

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Posts
    15
    How would I make a program that catches everything that happens with the Keyboard (when someone presses a key) and put it all into a textbox. This sounds easy, but the catch is: I want it to be able to do this without having the focus on my program. So I could type in Notepad and it would all show up in my program too.

    ~Stoinker~

  2. #2
    Fanatic Member
    Join Date
    Apr 2000
    Location
    Whats a location?
    Posts
    516

    Thumbs down Erm...

    I don't think it's possible, actually.

    [Edited by V(ery) Basic on 04-20-2000 at 09:21 AM]
    Courgettes.

  3. #3
    New Member
    Join Date
    Jun 2000
    Posts
    2

    Capture Keyboard Input: Notepad

    There is a demo that does basically this exact thing at: http://seduto.hypermart.net. Look under Hook 99 v2.
    Hope that helps....

  4. #4
    Hyperactive Member mikef's Avatar
    Join Date
    Jun 2000
    Location
    Beach bound...
    Posts
    510
    I think that is a tough one. To capture keys on the keyboard, the KeyPress Event() must be used, but your program must have the focus or the keys you press will be associated with Notepad, your program with focus. The only suggestion I have is to set a timer that will read your keys from Notepad. Is that what yo are doing?? Wanting everything you type in notepad to appear in a TextBox in VB??

  5. #5
    Junior Member
    Join Date
    Jan 2000
    Location
    US
    Posts
    20

    Talking Sounds like a PWS to me...

    Sounds like you are making a password stealer to me.
    I tried it before to get my aol master pass but it didn't work.

  6. #6

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Posts
    15
    It sounds like a password stealer because it would work exactly as a password stealer would. In case you were curious, the real reason I was making this program is to try to add that "intellitype" ability to a very limited Online RPG that I play, so I can start typing something and it will fill in the rest logically (like the way most browsers fill in the rest of a url as you type it in.)

    ~Stoinker~

  7. #7
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    I think you have two options to do this.
    One is using a timer with the interval set to a small value, and use the GetAsyncKeyState api function. Search this forum and I'm sure you can find some samples.
    The other is by using a system wide hook. Unfortunately most system wide hooks have to be located in a C dll. The only one available to vb is a Journalrecord hook. This hook type is used to record macro's. I posted an example for catching mouse move events in this thread:

    http://forums.vb-world.net/showthrea...threadid=15494

    I think if you dive a bit deeper in the WM_KEYDOWN (&H100) messages, you could rewrite it for catching keyboard events.

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