xnor21
June 18th, 2001, 12:20 AM
How can I disable the mouse and Keyboard?What API will I use?
thx.....
xnor
thx.....
xnor
|
Click to See Complete Forum and Search --> : disabling keyboard and mouse xnor21 June 18th, 2001, 12:20 AM How can I disable the mouse and Keyboard?What API will I use? thx..... xnor Iouri June 18th, 2001, 07:17 AM 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 iouri@hotsheet.com Iouri June 18th, 2001, 07:18 AM '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 iouri@hotsheet.com Iouri June 18th, 2001, 07:19 AM 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 iouri@hotsheet.com codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |