How can I disable the mouse and Keyboard?What API will I use?
thx.....
xnor
Printable View
How can I disable the mouse and Keyboard?What API will I use?
thx.....
xnor
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]
'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]
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]