Relationship between Hardware Cursor and Window..

BlitzMax Forums/BlitzMax Programming/Relationship between Hardware Cursor and Window..

Gabriel(Posted 2006) [#1]
.. Cursor.

Is there a direct way to know what the Windows hardware cursor position ( SetCursorPos,GetCursorPos ) *SHOULD* be ( not what it actually is ) from the mouse position within a window. In theory, it should be the position of the window, plus the position *WITHIN* the window, plus whatever the frame of the window takes, right? But is there a 100% way to calculate that?


fredborg(Posted 2006) [#2]
It's not the clearest explanation of what you want, you've got there :)

Anyway, I'm pretty sure what you are after is hidden in this jurassic code archives entry: http://www.blitzbasic.com/codearcs/codearcs.php?code=829

Obviously not BMax, but easy to convert...


ImaginaryHuman(Posted 2006) [#3]
Sounds like you're on the right track .... get the topleft X,Y of the canvas or whatever you're reading coords from, then add it to the topleft X,Y of the window, plus the difference between the window's XY and the canvas's XY to take into account the title bar etc.


Gabriel(Posted 2006) [#4]
It's not the clearest explanation of what you want, you've got there :)

Heh, sorry, but you're right, I'm not great at explaining things. I often don't know the right terms.

You're right though, ClientToScreen was exactly what I needed, and is working beautifully. Many thanks!