VB.NET disable the keyboard and mouse

試著忘記壹切 提交于 2019-12-20 03:07:19

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!