Handling hotkeys in Windows Forms application
There may be situations where you want to launch your windows application using an hotkey. I assume that, you have already set hot key for your windows application. So, in the form, all you need to do is, override the WndProc method as shown below,
public partial class Main : Form
protected override void WndProc(ref Message m)
if (m.Msg == 786)
//place your code here
the number 786 will confirm whether the keys hit in keyboard is the hotkey for this application. This method will fireup even if the form is not in focus/minimized.
No comments yet.