win32api.ClipCursor

ClipCursor(left, top, right, bottom)

Confines the cursor to a rectangular area on the screen.

Parameters

left, top, right, bottom : (int, int, int, int)

contains the screen coordinates of the upper-left and lower-right corners of the confining rectangle. If this parameter is omitted or (0,0,0,0), the cursor is free to move anywhere on the screen.

Win32 API References

Search for ClipCursor at msdn, google or google groups.