Advertisement

setting mousecursor position

Started by April 29, 2000 11:21 PM
1 comment, last by gameprogrammerwiz 24 years, 8 months ago
it there any way that i can set the mousecursor to appear in a specified place when my program starts? maybe in the bottom-righthand corner of the screen (x=800 y=600.
==============================
whats a signature?
htm[s]l[/s]
You just make two variables, mouseX and mouseY, set these equal to 800 and 600, and then add on the movement of the mouse to these variables each time you check them. Or, if you are receiving actualr coordinates for the mouse, not just the amount it has moved, make another set of variables, oldMouseX and oldMouseY, use these to find how much the mouse has moved, and then display the cursor at the correct location.

Ben
Advertisement
If you''re using GDI, the function to move the mouse cursor is SetCursorPos(int x, int y).

This topic is closed to new replies.

Advertisement