views:

2889

answers:

1

I have a WPF application that I minimize to the system tray through this.Hide() and System.Windows.Forms.NotifyIcon. When it's minimized, I want to have a keyboard hook maximize the application. How do I register a keyboard hook like Windows-Button & T, for example.

Thanks.

+4  A: 

If you don't mind Win32 API calls, I'd say your best bet is to call RegisterHotKey. You pass it the modifier and key to catch, then a WM_HOTKEY is sent to the HWND that you passed in originally.

Andy