Hopefully, you along with a few others that want to know how to do this, will read this. Especially if the thread has your name on it. I know I read threads with my name on them .

Anyways...


As you know, this code disables the keyboard:

Code:
Shell "rundll32 keyboard,disable"
But this code does not re-enable it:

Code:
Shell "rundll32 keyboard,enable"
Instead, it gives an error. Probably because the code was ment to disable the keyboard forever until the computer is restarted.

Here is an API function that will be able to block out the mouse and keyboard and still be able to re-enable them.

Of course, you will have to set a timer or something since you can't exactly click or press the keyboard to re-enable it.

But you can use the BlockInput API function to do it.


Code:
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


Hope this may be of use to you and anyone else that needs it, since I doubt you will get anywhere with the other code.