C#/WPF hotkey on a not focused form (like launchy)

你。 提交于 2019-12-23 19:43:17

问题


Is it possible to catch a hotkey (eg. Ctrl+Space) from a not focused form, to make it appear whenever someone uses this specific hotkey ; And without having to register this hotkey on the registry. A similar event can be noticed in the application "Launchy".

Thank you


Language : C# (WPF) // OS : Windows


回答1:


You need to call the RegisterHotKey API function.
Here is a WPF wrapper.




回答2:


I think you will need to do that in the Active form by handling KeyDown Event



来源:https://stackoverflow.com/questions/4829222/c-wpf-hotkey-on-a-not-focused-form-like-launchy

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!