开发者

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

开发者 https://www.devze.com 2023-02-07 11:56 出处:网络
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.

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) // 开发者_StackOverflow社区OS : Windows


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消