I want to make a click with the mouse but i don't find the right API. How can i do ?
Printable View
I want to make a click with the mouse but i don't find the right API. How can i do ?
Do you want to simulate the click on a spot on your form?
Or ona general spot on the screen?
I want to simulate a click anywhere on the screen.
I'm 99% sure the SendMessage API will do it for you:
For further info about the use of the API post a message at the API board.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
That's about the best I can do.
Hope this helps! ;)
Thank you for your help !
Produce Left ClickCode: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)