问题
I am looking to create a VB.NET application. when the application is opened it will disable the keyboard and mouse so if you hit any keys it does nothing and you can not move the mouse. (even if currently selected window is not that of application).
MUST WORK ON WINDOWS 7!
Thanks in advance.
回答1:
Both the mouse and the keyboard will be quite dead when you P/Invoke BlockInput(). The three finger salute will be required. Visit pinvoke.net for the declaration.
回答2:
Not going to happen, and not something you should really be trying to achieve in isolation.
You can (rightly) never intercept Ctrl+Alt+Del, for example
回答3:
Take a look at global hooks. They are bad. They are evil. But the exist because every once in a while someone actually needs them.
来源:https://stackoverflow.com/questions/2828925/vb-net-disable-the-keyboard-and-mouse