I\'m having the following issue in a WinForms app. I\'m trying to implement Hotkeys and I need to process Key messages whenever the control is active, no matter if the focus
const int WM_KEYDOWN = 0x100;
const int WM_KEYUP = 0x101;
protected override bool ProcessKeyPreview(ref Message m)
{
if (m.Msg == WM_KEYDOWN && (Keys)m.WParam == Keys.NumPad6)
{
//Do something
}
else if (m.Msg == WM_KEYUP && (Keys)m.WParam == Keys.NumPad6)
{
//Do something
}
return base.ProcessKeyPreview(ref m);
}