I've a C# application which performs a specific action whenever i press CTRL+1 keys. But the problem is CTRL+1 method only works when the form is in focus. when I minimize the form to system tray then CTRL+1 doesn't work. can anyone tell me how to track pressed keys even the form is minimized?
Asked
Active
Viewed 93 times
0
-
1Take a look at [RegisterHotKey](http://msdn.microsoft.com/en-us/library/windows/desktop/ms646309%28v=vs.85%29.aspx). You have an example [there](http://www.codeproject.com/Articles/3055/System-Hotkey-Component) – Alessandro D'Andria Sep 09 '13 at 12:00
-
You have to register to a global hotkey: [http://stackoverflow.com/questions/8734453/detect-keypression-when-minimized-and-trayicon][1] [1]: http://stackoverflow.com/questions/8734453/detect-keypression-when-minimized-and-trayicon – Tintenfiisch Sep 09 '13 at 12:01
-
I believe that [this](http://stackoverflow.com/questions/2450373/set-global-hotkeys-using-c-sharp) could help you out. Good Luck! – Evar Smith Sep 09 '13 at 15:03