View Full Version : Set Mouse Pos...
Vancete
04-26-2007, 12:24 PM
Hi!
How i can set the mouse position??
Greetings!!;)
RizlaUK
04-26-2007, 12:52 PM
ams cant set the mouse position, but you can use the sendkeys (http://www.warmuskerken.com/SendKeys.htm) plugin to simulate a mouse click
or i could make you a small addon (with autoit) that will actualy move the mouse cursor
Vancete
04-26-2007, 12:55 PM
ams cant set the mouse position, but you can use the sendkeys (http://www.warmuskerken.com/SendKeys.htm) plugin to simulate a mouse click
or i could make you a small addon (with autoit) that will actualy move the mouse cursor
Thanks a lot!!
And please,make me the addon with autoit...
Greetings!!;)
PD:Sorry for my english,im from spain!
RizlaUK
04-26-2007, 01:27 PM
here, the example is very easy to use the code is in the "Move" button
you can set the position and speed that the mouse moves, you can use raw numbers
ie:
sX = 100
sY = 100
speed = 0
result = File.Run( "AutoPlay\\Docs\\MouseMove.exe", sX..' '..sY..' '..speed, "", SW_SHOWNORMAL, false);
output enhanced with AMS Code Pretty (http://www.indigorose.com/forums/showthread.php?t=19409)
but if you use inputs like i did in this example then you must use "String.ToNumber"
ie:
sX = Input.GetText( "x");
sY = Input.GetText( "y");
speed = Input.GetText( "speed");
sX = String.ToNumber(sX);
sY = String.ToNumber(sY);
speed = String.ToNumber(speed);
result = File.Run( "AutoPlay\\Docs\\MouseMove.exe", sX..' '..sY..' '..speed, "", SW_SHOWNORMAL, false);
output enhanced with AMS Code Pretty (http://www.indigorose.com/forums/showthread.php?t=19409)
hope this helps ;)
FYI, this will not work on win 95, 98, 98se, or ME,
Or you can use this which will work on all platforms :)
nResult = DLL.CallFunction(_SystemFolder.."\\User32.dll", "SetCursorPos", "25, 100", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
RizlaUK
04-26-2007, 02:19 PM
handy to know, cheers worm :yes
i should really read up on the user32.dll as i always seem to go the hard way about things
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.