void ClipCursor(lpRect)
This function confines the cursor to the rectangle on the display screen given by the lpRect parameter. If a subsequent cursor position, given with the SetCursorPos function or the mouse, lies outside the rectangle, Windows automatically adjusts the position to keep the cursor inside. If lpRect is NULL, the cursor is free to move anywhere on the display screen.
Parameter | Type/Description |
lpRect | LPRECT Points to a RECT data structure that contains the screen coordinates of the upper-left and lower-right corners of the confining rectangle. |
None.
The cursor is a shared resource. An application that has confined the cursor to a given rectangle must free it before relinquishing control to another application.