Click to See Complete Forum and Search --> : disable/enable mouse
shtirliz
Sep 14th, 2000, 11:42 AM
Hi,
Does anybody know a way to disable/enable the mouse and see if the mouse even exist in hardware profile?
Thanks
Mad Compie
Sep 14th, 2000, 01:56 PM
I think you could use this:
Private Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long
Private Sub Form_Load()
ShowCursor 0 'Hide the cursor
'Wait 10 seconds
t = Timer
Do: DoEvents: Loop Until Timer > t + 10
ShowCursor 1 'Show the cursor
End Sub
But this only hides the pointer, it does not disable it.
I'll try to look at other possibilities.
kedaman
Sep 15th, 2000, 08:14 AM
To both hide and disable:
http://209.207.250.147/showthread.php?threadid=26425
Mad Compie
Sep 15th, 2000, 01:29 PM
Wright, Kedaman!
It was the ClipCursor thing.
Some APIs are not in Win2000, so you can set the cursor position into a form and add:
Private Sub Form_Mousemove()
'code for setting cursor position
End Sub
Strange how I could suggest AGAINST API. [!]
Mad Compie
Sep 19th, 2000, 02:20 PM
Consider that with your approach the mouse event still occurs. Clipcursor reduces the mouse area to a zero-sized rect, which really disables your mouse. So, I stay with Kedaman's approach...
OK, mc, I guess you're right. I really messed up that one, and I'm sorry.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.