ClipCursor

2.x

  void ClipCursor(lprc)    
  const RECT FAR* lprc; /* address of structure with rectangle */

The ClipCursor function confines the cursor to a rectangle on the screen. If a subsequent cursor position (set by the SetCursorPos function or by the mouse) lies outside the rectangle, Windows automatically adjusts the position to keep the cursor inside.

Parameters

lprc

Points to a RECT structure that contains the screen coordinates of the upper-left and lower-right corners of the confining rectangle. If this parameter is NULL, the cursor is free to move anywhere on the screen. The RECT structure has the following form:

typedef struct tagRECT {    /* rc */
   int left;
   int top;
   int right;
   int bottom;
} RECT;

For a full description of this structure, see the Microsoft Windows Programmer's Reference, Volume 3.

Return Value

This function does not return a value.

Comments

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.

See Also

GetClipCursor, GetCursorPos, SetCursorPos