|
-
Mar 27th, 2000, 09:19 AM
#1
regarding to the subject, may i know how to use API to disable the mouse and enable it back.
Thanks
-
Mar 27th, 2000, 12:45 PM
#2
Hyperactive Member
u can use the clipCursor and showCursor APIs.
ShowCursor will show/hide the cursor depending on the parameter passed.
using clipCursor u can restrict the area that the mouse can move in to 1 pixel, effectively preventing its movement.
Declarations: (in the module)
Public Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long
Public Declare Function ClipCursor Lib "user32" (lpRect As Any) As Long
Code - In the form:
'Declarations
Private Type RECT
Left As Long
Right As Long
Top As Long
Bottom As Long
End Type
'To disable the mouse
With TRect1
.Left = 0
.Top = 0
.Right = 1
.Bottom = 1
End With
ClipCursor TRect1
ShowCursor False
'To enable the mouse
ClipCursor ByVal 0&
ShowCursor True
Let me know if this works. It should! )
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|