Moving mouse pointer

How to move mouse pointer over my window and click a button ?(Don't say using mouse)
Who is Participating?
mcriderConnect With a Mentor Commented:
I think you're looking for the GetCursorPos and SetCursorPos API calls...

GetCursorPos get's the mousepointer's x/y coordinates and SetCursorPos sets the mousepointer's x/y coordinates.

They're defined like this:

        x As Long
        y As Long
End Type
Declare Function GetCursorPos Lib "user32" Alias "GetCursorPos" (lpPoint As POINTAPI) As Long
Declare Function SetCursorPos Lib "user32" Alias "SetCursorPos" (ByVal x As Long, ByVal y As Long) As Long

As for generating a mouseclick, See: 


All Courses

From novice to tech pro — start learning today.