VB.NET禁用键盘和鼠标
我正在寻找创建一个 VB.NET 应用程序。当应用程序打开时,它将禁用键盘和鼠标,因此如果您按任何键,它不会执行任何操作,并且您无法移动鼠标。 (即使当前选择的窗口不是应用程序的窗口)。
必须在 Windows 7 上运行!
提前致谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
当您 P/Invoke BlockInput()。需要行三指礼。请访问 pinvoke.net 查看声明。
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.
这不会发生,也不应该是你真正应该试图孤立地实现的目标。
例如,您可以(正确地)永远不会拦截 Ctrl+Alt+Del
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
查看全局挂钩。他们很糟糕。他们是邪恶的。但它们的存在是因为每隔一段时间就会有人真正需要它们。
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.