Windows Mobile 6.5
A version of this page is also available for

This function moves the cursor to the specified screen coordinates. If the new coordinates are not within the screen rectangle set by the most recent ClipCursor function, Windows Mobile automatically adjusts the coordinates so the cursor stays within the rectangle.

BOOL SetCursorPos( 
  int x, 
  int y


[in] Specifies the new x-coordinate, in screen coordinates, of the cursor.


[in] Specifies the new y-coordinate, in screen coordinates, of the cursor.

Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.

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

The calling process must have WINSTA_WRITEATTRIBUTES access to the window station.

LibraryCursor.lib, Mcursor.lib
Windows Embedded CEWindows CE 1.0 and later
Windows MobileWindows Mobile Version 5.0 and later

Community Additions