|
-
Nov 5th, 1999, 07:33 AM
#1
Thread Starter
Addicted Member
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!
-
Nov 5th, 1999, 09:17 AM
#2
You can use the GetAsyncKeyState API with the Timer Control to Monitor the Virtual Key Codes activated from any Application, eg.
Code:
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
[email protected]
[email protected]
-
Feb 12th, 2000, 04:42 PM
#3
New Member
Thanks. I think that really helps alot.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|