regarding to the subject, may i know how to use API to disable the mouse and enable it back.
Thanks
Printable View
regarding to the subject, may i know how to use API to disable the mouse and enable it back.
Thanks
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! :o)