Click to See Complete Forum and Search --> : Global Keystrokes Capturing
ShIzO
Nov 5th, 1999, 06:33 AM
does anyone know how to capture keystrokes globally. What i mean Globally is that anything that is being typed on the computer, not only in my application. For example, capture the keys when typing something in the MS Word or anything else.
I just want to be able to send these keystrokes to my application but still be able to use other programs without any problems.
Please help!
Aaron Young
Nov 5th, 1999, 08:17 AM
You can use the GetAsyncKeyState API with the Timer Control to Monitor the Virtual Key Codes activated from any Application, eg.
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Sub Form_Load()
Timer1.Interval = 100
End Sub
Private Sub Timer1_Timer()
Dim iKey As Integer
For iKey = 0 To 255
If GetAsyncKeyState(iKey) Then Caption = "Virtual KeyCode: " & iKey & " was pressed."
Next
End Sub
------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
adyoung@win.bright.net
Denpong
Feb 12th, 2000, 03:42 PM
Thanks. I think that really helps alot.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.