I answered a question like this the other day. (At least it would do what you are looking for, but does require subclassing your window). Anyway, if you are interested, take a look at this thread
Hope this helps.
Printable View
I answered a question like this the other day. (At least it would do what you are looking for, but does require subclassing your window). Anyway, if you are interested, take a look at this thread
Hope this helps.
Thanks Matthew + reeset, I think Matthews code is alot simpler and shorter =) !
Here's how to distinguish the mouse buttons.
Code:Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Sub Form_Load()
Timer1.Interval = 1
End Sub
Private Sub Timer1_Timer()
If GetAsyncKeyState(vbLeftButton) Then Print "Left Button"
If GetAsyncKeyState(vbRightButton) Then Print "Right Button"
If GetAsyncKeyState(vbMiddleButton) Then Print "Middle Button"
End Sub