SetCursorPos

Syntax

void SetCursorPos(X,Y)

This function moves the cursor to the screen coordinates given by the X and Y parameters. If the new coordinates are not within the screen rectangle set by the most recent ClipCursor function, Windows automatically adjusts the coordinates so that the cursor stays within the rectangle.

Parameter Type/Description  

X int Specifies the new x-coordinate (in screen coordinates) of the cursor.  
Y int Specifies the new y-coordinate (in screen coordinates) of the cursor.  

Return Value

None.

Comments

The cursor is a shared resource. A window should move the cursor only when the cursor is in its client area.