Results 1 to 2 of 2

Thread: Keyboard Capture

  1. #1

    Thread Starter
    Addicted Member finn0013's Avatar
    Join Date
    Jan 2001
    Location
    Charleston, SC
    Posts
    222

    Keyboard Capture

    Anyone know how to create a keyboard capture app in VB?

    I need this to monitor a windows 98 machine. I have tried using the GetMessage API call, however I don't have much practice with the API so I may just be doing it wrong...

    Also, does anyone know of a way (in VB) to bypass the messaging queues and get data directly from the Raw Input Thread?

  2. #2
    sunnyl
    Guest
    About key monitoring (logging?). You can use the GetAsyncKeyState API.

    VB Code:
    1. Private Declare Function GetAsyncKeyState Lib "user32" Alias "GetAsyncKeyState" (ByVal vKey As Long) As Integer
    2. Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    3.  
    4. Public Sub ScanForKey()
    5.     Do
    6.         For i = 3 To 255
    7.             If GetAsyncKeyState(i) Then
    8.                 Debug.Print Chr(i)
    9.             End If
    10.         Next
    11.         DoEvents
    12.         Sleep 100
    13.     Loop
    14. End Sub

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