I have overridden wndproc() to use Hotkeys. but the form won't close anymore. and onclosing form the program stuck in an infinite loop in wndproc().
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
if (m.Msg == 0x0312)
{
Keys key = (Keys)(((int)m.LParam >> 16) & 0xFFFF);
int id = m.WParam.ToInt32();
MessageBox.Show("Hotkey has been pressed!");
// do something
}
}
i have set the e.cancel to true and added following codes in the OnFoemClosing method `
e.Cancel = false;
base.OnFormClosing(e);
But nothing happens.