Declare Function GetClipCursor Lib "user32.dll" (lprc As RECT) As Long
Platforms: Win 32s, Win 95/98, Win NT
GetClipCursor finds the current confinement rectangle of the mouse cursor. The mouse cursor is confined by using ClipCursor. The cursor is confined inside this rectangle -- even SetCursorPos cannot free it. If there is no apparent confinement rectangle, it is actually the size of the screen. The coordinates of the rectangle is put into lprc. The function returns 0 if an error occured, or 1 if it succeeded.
Example:
' Display the coordinates of the confinement rectangle.
Dim r As RECT ' receives coordinates of rectangle
Dim retval As Long ' return value
retval = GetClipCursor(r) ' read the coordinates and put them into r
Debug.Print r.Left; r.Top ' display upper-left (x,y) pair
Debug.Print r.Right; r.Bottom ' display lower-right (x,y) pair
Related Call: ClipCursor
Category: Cursor
Back to the index.