|
-
Mar 16th, 2001, 12:07 AM
#1
Thread Starter
Junior Member
Can anyone tell me how to use api calls to retrieve the clicking of the mouse? Or is it impossible?
-
Mar 16th, 2001, 12:59 AM
#2
you can detect Mouseclicks pretty easily using a function that you would never think of, due to its name.
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Sub Command1_Click()
Dim KeyState As Integer
Do While DoEvents > 0
KeyState = GetAsyncKeyState(vbKeyLButton)
Debug.Print KeyState
If (KeyState And &HF000) <> 0 Then MsgBox "Mouse1"
KeyState = GetAsyncKeyState(vbKeyRButton)
If (KeyState And &HF000) <> 0 Then MsgBox "Mouse2"
KeyState = GetAsyncKeyState(vbKeyMButton)
If (KeyState And &HF000) <> 0 Then MsgBox "Mouse3"
Loop
End Sub
Last edited by Lord Orwell; Mar 16th, 2001 at 09:59 PM.
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
|