VB.NET 禁用键盘和鼠标 [英] VB.NET disable the keyboard and mouse

查看:47
本文介绍了VB.NET 禁用键盘和鼠标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望创建一个 VB.NET 应用程序.当应用程序打开时,它将禁用键盘和鼠标,因此如果您按任何键,它什么也不做,您将无法移动鼠标.(即使当前选择的窗口不是应用程序的窗口).

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).

必须在 WINDOWS 7 上工作!

MUST WORK ON WINDOWS 7!

提前致谢.

推荐答案

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.

这篇关于VB.NET 禁用键盘和鼠标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆