0
votes

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 third-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?

1
I wrote a C# winforms app pretty much exclusively to receive hotkey messages. It's designed to run in the background. I just checked its current memory usage and it's at 604k. Is that a lot?Nick Spreitzer

1 Answers

3
votes

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.