C#使用低级别的Windows API勾子阻止个别按键
作者:作者不详  发布日期:2011/06/16 22:15:46
C#使用低级别的Windows API勾子阻止个别按键

Low-level Windows API hooks from C# to stop unwanted keystrokes

 

Introduction

 

Cats and babies have a lot in common. They both like eating the house plants, and share the same hatred of closed doors. They also love using keyboards, with the result that the important email you were sending to your boss is dispatched in mid-sentence, your accounts in Excel are embellished with four rows of gobbledygook, and your failure to notice that Windows Explorer was open results in several files moving to the Recycle Bin.

The solution is an application which you can switch to as soon as the keyboard is under threat, and which will ensure that any keyboard activity is harmless. This article illustrates how the keyboard can be neutralized in a C# application using a low-level Windows API hook.


CSFramework翻译:

C#使用低级别的Windows API勾子阻止个别按键

C#应用程序中使用低级别的Windows API钩子

猫和婴儿有很多共同点,他们都喜欢咬室内盆栽,而且同样讨厌被关着.他们都同样喜欢玩弄键盘,以致你将要发送给你老板的重要邮件被打断了,你Excel中的帐户有4行被胡乱修改,你没有注意到你的资源浏览器打开了, 里面的部分文件被转移到了资源回收站.

该解决方案是个应用程序,您可以使用快捷键切换只要键盘受到威胁,并确保任何键盘活动是无害的。

本文介绍了如何在C#应用程序中使用低级别的Windows API钩子。


程序截图:


贴图图片


原文:http://www.codeproject.com/KB/system/CSLLKeyboard.aspx



本文来源:



C/S框架网|原创精神.创造价值.打造精品


扫一扫加作者微信
C/S框架网作者微信 C/S框架网|原创作品.质量保障.竭诚为您服务


点击下载附件 点击下载附件 (如下载失败,请邮件通知我们寄回给您,或QQ:23404761留言.)
上一篇 下一篇