Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Is there a way to force your mouse to move?
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
HazySmoke)345




PostPosted: Fri Nov 18, 2005 5:08 pm   Post subject: Is there a way to force your mouse to move?

Such as, forcing it to move and click somewhere and such using a program. Is it possible to code it with VB?
Sponsor
Sponsor
Sponsor
sponsor
[Gandalf]




PostPosted: Fri Nov 18, 2005 7:08 pm   Post subject: (No subject)

Not sure about VB, but it is highly possible using macros. Look them up on google and you will find everything you need.
Brightguy




PostPosted: Fri Nov 18, 2005 10:30 pm   Post subject: Re: Is there a way to force your mouse to move?

Play around with SetCursorPos and mouse_event. Here's the basic outline to get you started:

VisualBASIC:
Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)

Private Const MOUSEEVENTF_LEFTDOWN = &H2
Private Const MOUSEEVENTF_LEFTUP = &H4

Private Sub SimulateClick(x As Long, y As Long)
    SetCursorPos x, y
    mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0&, 0&, 0&, 0&
End Sub
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: