Results 1 to 2 of 2

Thread: mouse click seems easy, but its hard!

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Location
    Petach-Tekvia
    Posts
    25
    Using API, how can give a message box if the right
    clikc of the mouse is clicked?!!!???


    thanks

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width