Question How to register multiple global hot-keys?

sriptick

New member
Joined
Apr 14, 2013
Messages
1
Programming Experience
1-3
Hi everyone,
I want to register multiple global hotkeys. CTRL+A , SHIFT+B etc etc etc.
I want to more clear :
If i pressed : CTRL+A then a message will show (MessageBox.Show("Pavel,Tangal")
If i pressed SHIFT+B then minimize application.
If i pressed SHIFT+C maximize application.

I found a solution on internet related to it but i can not add here modifiers keys like : CTRL or SHIFT or ALT etc.

It is like : A,B,C,D

Sorry for my English. :unconscious::unconscious:

Pls see my project sample and pls help me. (on attach)
Thanks
 

Attachments

  • HookLibrary.zip
    13.8 KB · Views: 32

jmcilhinney

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
3,271
Location
Sydney, Australia
Programming Experience
10+
Neither of those two combinations make sense as hotkeys because they have standard uses. Ctrl+A is a Windows standard for Select All and Shift+B is obviously just an upper case B. If you want to register a hotkey then you should select a key combination that is unlikely to mean something to other applications. With that in mind, hotkeys should pretty much always involve at least two modifiers, e.g. Ctrl+Shift+A.

As for how to do it, there are examples all over the place. The modifiers are bitwise ORed together and passed as a separate argument to RegisterHotKey, e.g.

.net - how to use RegisterHotKey() in C#? - Stack Overflow
 
Top Bottom