I wanna make this program that will move the mouse by giving it some move mouse command, i know the move cursor or sumthing like that and then make em loop or is that it?, anyways is there a better one I can do? HELP!!! :(
Printable View
I wanna make this program that will move the mouse by giving it some move mouse command, i know the move cursor or sumthing like that and then make em loop or is that it?, anyways is there a better one I can do? HELP!!! :(
You might check out the mouse_event API, which synthesizes mouse movement and button clicking by placing mouse input information into the input stream.
Check out this link for details:
http://www.vbapi.com/ref/m/mouse_event.html
Hope that helps!
~seaweed
Or if you don't want to do that... here's source code!!! Yay...
Declare the following in a module:
[code]
Option Explicit
Type POINTAPI
x As Long
y As Long
End Type
Declare Function SetCursorPos& Lib "user32" _
(ByVal x As Long, ByVal y As Long)
Declare Function GetCursorPos Lib "user32" _
(lpPoint As POINTAPI) As Long
[code]
Put this in a timer:
This moves it x, y from the current position of the mouse rather then scattering all over the screen.Code:Private Sub Timer1_Timer()
Dim mp As POINTAPI
GetCursorPos mp
SetCursorPos mp.x + (Int(Rnd * 20 + 1) - 10), mp.y + (Int(Rnd * 20 + 1) - 10)
End Sub
Good luck,
------------------
DiGiTaIErRoR
VB, QBasic, Iptscrae, HTML
Quote: There are no stupid questions, just stupid people.
Thanxx to both of ye!!!!! I appreciate it!!!!! :)