在 C# 中设置应用程序范围的热键
There is a post to set system-wide global hotkey in C#
here
I want to set application-wide hotkey such that if user presses a hotkey on any child window of an application, a particular window will receive and process it.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以为应用程序创建一个基本表单,并将 keypreview 属性设置为 true 并处理 keydown 事件,以便所有表单都具有相同的键定义。
您还可以使用以下例程为表单注册热键,但在此方法中,您需要在每个表单的加载事件上调用相同的方法。
您还可以使用 user32.dll 中的以下非托管方法,但我当然不会建议这样做。
You can create a base form for your application and set keypreview property to true and handle keydown event so all your forms will have the same key definition.
You also can use the following routine to register a hotkey for your forms but in this method, you will require to call same method on load event of each form.
You also can use the following unmanaged methods from user32.dll but of course i would not suggest that.