Link to home
Start Free TrialLog in
Avatar of soriega
soriegaFlag for Sweden

asked on

Moving mouse to position (X,Y) on screen

I have some trouble getting the mouse to point at a specific position (X,Y) on the screen. I tried using this, but haven't found a solution that works in vb.net (i use Visual Studio 2005)

 Private Declare Function ClientToScreen Lib "user32" _
    (ByVal hwnd As Long, ByVal lpPoint As POINTAPI) As Long
    Private Declare Function SetCursorPos Lib "user32" _
    (ByVal x As Long, ByVal y As Long) As Long

Any thoughts ?
ASKER CERTIFIED SOLUTION
Avatar of torimar
torimar
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mike Tomlinson
You don't need to use the WinAPIs for this...

Just use:

    Cursor.Position = New Point(500, 350)