|
-
June 18th, 2001, 12:20 AM
#1
disabling keyboard and mouse
How can I disable the mouse and Keyboard?What API will I use?
thx.....
xnor
-
June 18th, 2001, 07:17 AM
#2
Re: disabling keyboard and mouse
Shell "rundll32 keyboard,disable"
but you have to reboot in order to enable the keyboard
you can't use enable in this command
Iouri Boutchkine
[email protected]
-
June 18th, 2001, 07:18 AM
#3
Re: disabling keyboard and mouse
'that will disable keyboard only for this application
Dim flag_ed As Boolean
Private Sub Command1_Click()
flag_ed = Not flag_ed
If flag_ed Then
Command1.Caption = "Disable KeyBoard"
Else
Command1.Caption = "Enable KeyBoard"
End If
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If flag_ed Then
Else
KeyCode = 0
End If
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)
If flag_ed Then
Else
KeyAscii = 0
End If
End Sub
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
If flag_ed Then
Else
KeyCode = 0
End If
End Sub
Private Sub Form_Load()
flag_ed = True
Command1.Caption = "Disable KeyBoard"
End Sub
Iouri Boutchkine
[email protected]
-
June 18th, 2001, 07:19 AM
#4
Re: disabling keyboard and mouse
I don't know how to disabnle a mouse, but an alternative way is to hide the pointer
Declare Function ShowCursor& Lib "user32" _
(ByVal bShow As Long)
'Add this code to Command1.
Private Sub Command1_Click()
ShowCursor (bShow = True)
End Sub
Private Sub Command2_Click()
ShowCursor (bShow = False)
End Sub
Iouri Boutchkine
[email protected]
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
|