Modulo.bas
Type RECT
left As Integer
top As Integer
right As Integer
bottom As Integer
End Type
Form1.frm
Option Explicit
Declare Sub GetWindowRect Lib "USER" (ByVal hWnd%, lpRect As RECT)
Declare Sub ClipCursorClear Lib "USER" Alias "ClipCursor" (ByVal lpRect&)
Declare Sub ClipCursor Lib "USER" (lpRect As RECT)
Sub Form_Resize ()
Dim lpRect As RECT
Call GetWindowRect(Me.hWnd, lpRect)
Call ClipCursor(lpRect)
End Sub
Sub Form_Unload (Cancel As Integer)
Call ClipCursorClear(0&)
End Sub