Hello!
How can I determine If a mouse button is pressed OUTSIDE the form?
Thank you for any help.
Printable View
Hello!
How can I determine If a mouse button is pressed OUTSIDE the form?
Thank you for any help.
You will need to install a global hook that monitors the mouse (the hook procedure has to be installed in a standard dll).
Use the GetAsyncKeyState API. It's not as accurate, but it's less complicated.
Code:Private Declare Function GetAsyncKeyState Lib "user32" Alias "GetAsyncKeyState" (ByVal vKey As Long) As Integer
Private Sub Timer1_Timer()
If GetAsyncKeyState(vbLeftButton) Then MsgBox "L Button pressed"
End Sub
Thank you for your help.