Author: Tomas Rutkauskas
Simulate a mouse click on our form (control)
Answer:
This is easily done by position the mouse cursor onto the form using SetCursorPos,
then using mouse_event to fake a mouse click.
1 2 // click in upper-left corner, 50 pixels inward3 SetCursorPos(Form1.Left + 50, Form1.Top + 50);
4 mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
5 mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);