Results 1 to 6 of 6

Thread: How can I simulate a mouse click ?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Posts
    22

    Question

    I want to make a click with the mouse but i don't find the right API. How can i do ?

  2. #2
    Guest

    Talking

    Do you want to simulate the click on a spot on your form?
    Or ona general spot on the screen?

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Posts
    22
    I want to simulate a click anywhere on the screen.

  4. #4
    Guest

    Talking SendMessage

    I'm 99% sure the SendMessage API will do it for you:

    Code:
    Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    For further info about the use of the API post a message at the API board.

    That's about the best I can do.
    Hope this helps!

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Posts
    22

    Wink

    Thank you for your help !

  6. #6
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    Code:
    Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
    Private Const MOUSEEVENTF_LEFTDOWN = &H2
    Private Const MOUSEEVENTF_LEFTUP = &H4
    
        Call mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
        Call mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
    Produce Left Click
    Chemically Formulated As:
    Dr. Nitro

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