C#仅阻止键盘输入
可能的重复:
如何在 C# 中阻止键盘和鼠标输入?< /a>
在 如何阻止键盘和鼠标输入在C#? 有一种方法可以在 C# 中阻止鼠标和键盘输入。 有没有办法只锁定键盘并允许鼠标输入?
Possible Duplicate:
How can I block keyboard and mouse input in C#?
Under How can I block keyboard and mouse input in C#? there is a way how to block mouse and keyboard input in C#.
Is there a way to lock only keyboard and allow mouse input?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
答案已经在您链接到的问题中。
本文:http://www.codeproject.com/KB/cs/globalhook.aspx< /a>
显示您需要前进的方向。它被称为低级钩子。我不确定他的实现到底是如何工作的,但在低级别,您可以选择将消息传递给其他进程。您可以选择不这样做,这将阻止输入传输到任何地方。
我建议下载他的代码,检查他的 P/Invoke 代码,看看他是否放弃了传递输入的选项,如果没有,请重写它,这样就可以了!
注意:我相信使用此方法 CTRL+ALT+DELETE 仍然无法“杀死”。
The answer is already in the question you link to.
This article: http://www.codeproject.com/KB/cs/globalhook.aspx
shows the direction you need to head towards. Its called a low level hook. I'm not sure how his implementation exactly works but at the low level you have the option of passing on the message to other processes. You can choose not and this will prevent input travelling anywhere.
I suggest downloading his code, examining his P/Invoke code and seeing if he passes up the option to pass on the input, if not, rewrite it so it does!
Note: I believe CTRL+ALT+DELETE is still not "killable" using this method.