Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleMove the mouse programmatically
DescriptionThis example shows how to move the mouse programmatically in Visual Basic 6 using the ClientToScreen and SetCursorPos API functions.
Keywordsmouse, move mouse
CategoriesAPI
 
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
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated