Page 1 of 1

Set Mouse X and Y in A Window

Posted: Wed Jun 22, 2011 3:09 pm
by captain_skank
Hi,

Is there a way to set the x,y of the mouse cursor in a window without using the mouse library ??

I have a window that i use windowmousex and windowmousey to fake a mouse over but i'd like to set the inital position well away from these areas.

Thanks

Re: Set Mouse X and Y in A Window

Posted: Wed Jun 22, 2011 3:13 pm
by ts-soft

Code: Select all

SetCursorPos_(x, y)

Re: Set Mouse X and Y in A Window

Posted: Wed Jun 22, 2011 3:26 pm
by captain_skank
dood - you are a lifesaver.

Funnily enough I was just flicking through the API but didn't register that setcursor would set the mouse position just the text cursor position.

Thanks

Re: Set Mouse X and Y in A Window

Posted: Wed Jun 22, 2011 3:43 pm
by Shield
The mouse pointer actually is called 'cursor' while the pointer for text is called 'caret'. :)
At least those are the terms that are used for WinAPI.