# Function Reference

# _WinAPI_ClipCursor

Confines the cursor to a rectangular area on the screen

#include <WinAPIRes.au3>
_WinAPI_ClipCursor ( $tRECT )

## Parameters

$tRECT | $tagRECT structure that contains the screen coordinates of the confining rectangle. If this parameter is 0, the cursor is free to move anywhere on the screen.

## Return Value

Success: | True.
Failure: | False, call _WinAPI_GetLastError() to get extended error information.

## Remarks

The cursor is a shared resource.
If an application confines the cursor, it must release the cursor by using _WinAPI_ClipCursor() before relinquishing control to another application.

## See Also

Search ClipCursor in MSDN Library.

## Example

    #include <WinAPIMisc.au3>
    #include <WinAPIRes.au3>

    _Example()

    Func _Example()
        _WinAPI_ClipCursor(_WinAPI_CreateRectEx(0, 0, 400, 400))
        Sleep(5000)
        _WinAPI_ClipCursor(0)
    EndFunc   ;==>_Example