Added: Aug 19, 2002
Snippet uploaded by: snippet
Written By: Unknown
Demo: Sorry, no demo
Restrict Mouse / Hide Cursor
Highlight all by clicking in box
'You can use the ClipCursor And ShowCursor APIs, ie.
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
Private Declare Function ClipCursor Lib "user32" (lpRect As Any) As Long
Private Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Sub Command1_Click()
Static bRestricted As Boolean
Dim tRECT As RECT
bRestricted = Not bRestricted
If bRestricted Then
'Restrict the Cursor to Inside the Form Area
Call GetWindowRect(hwnd, tRECT)
'Release the Cursor
Call ClipCursor(ByVal 0&)
Private Sub Command2_Click()
Static bHide As Boolean
bHide = Not bHide
Call ShowCursor(Abs(Not bHide))
No Comments to show
Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.
Adding your comment. Please wait...
Thanks for adding your comment!. After further review it will be added.
There was a problem adding your comment. Please try again.
Please complete all the fields in the form before sending.