Click to See Complete Forum and Search --> : Move Mouse API


HKothari
January 23rd, 2008, 05:28 PM
Is there a simple way to move the mouse to particular coordinates on the screen or in a window using windows api?

S_M_A
January 23rd, 2008, 06:25 PM
Hm, wasn't there a function for this before...

Well, the only way I can find at the moment to move mouse is by calling the function SendInput and that's not really complicated either. It depends on why you want to do this. If user moves the mouse at the same time the input will be inserted in a stream of other inputs your input might be un-noticable.

See MSDN http://msdn2.microsoft.com/en-us/library/ms646310.aspx and also follow the MOUSEINPUT link.

HKothari
January 23rd, 2008, 06:49 PM
Ok, thanks. :D

Plasmator
January 23rd, 2008, 08:25 PM
SetCursorPos is as simple as it gets.

HKothari
January 23rd, 2008, 10:29 PM
Oh, wow, thanks. :D

S_M_A
January 24th, 2008, 04:18 PM
That's the function yes... my memory has obviously become non-sticky... :(