Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 C# 中有这个功能,用于按键。当你按下一个键时会执行函数 a()
protected virtual void OnKeyPress(object sender, KeyPressEventArgs e) { a(); }
我需要一种方法来全局执行函数,在我的应用程序之外,在 .NET Framework 之外,在 Windows 的任何地方。
进阶谢谢!
PS:我不想开发恶意应用程序,建设性的(反键盘记录方法);)
CodeProject 上的这篇文章介绍了如何使用 .Net/C# 安装全局键盘挂钩来获取所需的事件。
http://www.codeproject.com/KB/cs/globalhook.aspx