Using API, how can give a message box if the right
clikc of the mouse is clicked?!!!???
thanks
Printable View
Using API, how can give a message box if the right
clikc of the mouse is clicked?!!!???
thanks
Sure thing. You can use GetAsyncKeyState API to find that out.
Add a timer control to your form and copy this code:
Code:Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Const VK_RBUTTON = 2
Private Sub Form_Load()
Timer1.Interval = 100
End Sub
Private Sub Timer1_Timer()
If GetAsyncKeyState(VK_RBUTTON) Then
MsgBox "Right Button pressed."
End If
End Sub