ID: 388
Viewed: 3388
Added: Aug 19, 2002
Version:
Snippet uploaded by: snippet
Written By: Matthew Gates
Demo: Sorry, no demo
Thank you for your vote. Please wait...
It appears you already voted for this snippet
It appears your vote value was empty
Two ways I know of to disable keyboard
Highlight all by clicking in box
<!---Declaration--->
none
Highlight All
<!---Code--->
'1 - Rundll32:
'code:
Shell "rundll32 keyboard,disable"
'2 - BlockInput API function (only problem with this is 'you disable both mouse and keyboard and you have to 'basically set a timer or something, or else you can't re-'enable them, but in the code below, there is an example 'of setting a time to disable and re-enable them).
Private Declare Function BlockInput Lib "user32" _
(ByVal fBlock As Long) As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal _
dwMilliseconds As Long)
Private Sub Command1_Click()
DoEvents
'block the mouse and keyboard input
BlockInput True
'wait 10 seconds before unblocking it
Sleep 10000
'unblock the mouse and keyboard input
BlockInput False
End Sub
;
No Comments to show
Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.
Adding your comment. Please wait...
Thanks for adding your comment!. After further review it will be added.
There was a problem adding your comment. Please try again.
Please complete all the fields in the form before sending.