Is there a way of trapping a mousedown outside a vb program
If not, how do I read the state of the mousebutton?
(And I don't mean in a mouse_down event...)
Printable View
Is there a way of trapping a mousedown outside a vb program
If not, how do I read the state of the mousebutton?
(And I don't mean in a mouse_down event...)
You can probably use a mouse hook, or to test whether a button is up or down you can use GetAsyncKeyState...
VB Code:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer Private Sub Timer1_Timer() If (GetAsyncKeyState(vbLeftButton) And &H8000) Then Me.Caption = "Left Button Down" Else Me.Caption = "Left Button Up" End If End Sub
That works OK!
But how about trapping keys from the keyboard outside a vbprogram?
This should help you...