Move the mouse cursor
By: Lorenzo Dalla Vecchia Date: 19/05/2001

The following code lets you move the mouse cursor to any position on the screen.
Start by adding the following API declaration to a module.

Declare Function SetCursorPos Lib "user32" _
(ByVal x As Long, ByVal y As Long) As Long

Moving the mouse cursor is then very simple.

Dim RetVal As Long
RetVal = SetCursorPos(x, y)

Replace x and y with the horizzontal and vertical coordinates on the screen (in pixels).

Click Here!


Visual Basic Programming Zone is a website by Lorenzo Dalla Vecchia.
To contact the Webmaster, click here.
Hosted by InWind: www.inwind.it