开发者

Other ways to define a custom global shortcut key in Windows for a C# program?

开发者 https://www.devze.com 2023-01-25 07:39 出处:网络
The first obvious way is to create a shortcut (.LNK) file in the Start Menu (or on Desktop) and in the Properties dialog to assign a keyboard shortcut (let\'s say Ctrl + Alt + F10).

The first obvious way is to create a shortcut (.LNK) file in the Start Menu (or on Desktop) and in the Properties dialog to assign a keyboard shortcut (let's say Ctrl + Alt + F10).

However, this way seems to have different issues, such as the shortcut key does not work if I'm pressing it in Firefox in Full Screen Mode (F11) or when playing a Flash video (such as a Youtube video) in Full Screen Mode.

Are there any other built-in ways in Windows to define a custom global shortcut? Maybe in the registry, etc.?

I'd like to avoid using RegisterHotKey because it would require my C# program (even simple .NET programs take a lot of memory) to always run in the background waiting for the hotkey (plus it must start with Windows, etc.)

Or are there thi开发者_StackOverflow中文版rd-party programs written in native code that are very small and can be deployed with my program to help me accomplish the task of having a hotkey for my C# program?


Here is a solution from a related Stackoverflow post:

Best way to tackle global hotkey processing in c#?

It links to a blog where you can download a library that does what you are looking for.

0

精彩评论

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