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
Set Mouse X and Y in A Window
- captain_skank
- Enthusiast
- Posts: 641
- Joined: Fri Oct 06, 2006 3:57 pm
- Location: England
Re: Set Mouse X and Y in A Window
Code: Select all
SetCursorPos_(x, y)
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

- captain_skank
- Enthusiast
- Posts: 641
- Joined: Fri Oct 06, 2006 3:57 pm
- Location: England
Re: Set Mouse X and Y in A Window
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
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
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.

At least those are the terms that are used for WinAPI.
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds