|
|
Title | Move the mouse programmatically |
Description | This example shows how to move the mouse programmatically in Visual Basic 6 using the ClientToScreen and SetCursorPos API functions. |
Keywords | mouse, move mouse |
Categories | API |
|
|
This program uses the ClientToScreen API function to convert the target coordinates from the screen's coordinate system to the screen's coordinates system. It then uses the SetCursorPos API function to move the mouse there.
|
|
Sub MoveMouse(x As Single, y As Single)
Dim pt As POINTAPI
pt.x = x
pt.y = y
ClientToScreen hwnd, pt
SetCursorPos pt.x, pt.y
End Sub
|
|
|
|
|
|