Moving mouse pointer

How to move mouse pointer over my window and click a button ?(Don't say using mouse)
sathesh_manieAsked:
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:

Type POINTAPI
        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:

http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=10244077 


Cheers!

0
All Courses

From novice to tech pro — start learning today.