Good morning folk,
a quick question to anyone who can help.
i am working on a program and i am using the below code to simulate mouse movement to certain
co-ords, but the thing is the co-ords 0 , 0 refer to the position at the very top left of the monitor.
what i want is for the co-ords 0 , 0 to refer to the top left in my form so the mouse clicks and
movements stay inside the form.
Here is the code:
any help will be much appriciated
Thanks
Danausitn
a quick question to anyone who can help.
i am working on a program and i am using the below code to simulate mouse movement to certain
co-ords, but the thing is the co-ords 0 , 0 refer to the position at the very top left of the monitor.
what i want is for the co-ords 0 , 0 to refer to the top left in my form so the mouse clicks and
movements stay inside the form.
Here is the code:
Code:
Public Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long
Public Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
Public Declare Function GetCursorPos Lib "user32" (lpPoint As PointAPI) As Long
Public Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long
Public Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Public Type PointAPI
x As Long
y As Long
End Type
Public Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Thanks
Danausitn
Comment