I have defined a HotKey Ctrl + Space to activate my Windows Form. When the form handles this HotKey, this event is not seen by the system. Is there subsequently any way to unhandle these keystrokes? (That is, unregister the HotKey.)
Here is what I have tried:
private int tuyen_HotKey_Active = 1208132019;
private void Reg_HotKey(bool mode)
{
if (mode)
{
RegisterHotKey(this.Handle, tuyen_HotKey_Active, 2, 32); // Ctrl + Space
}
else
{
UnregisterHotKey(this.Handle, tuyen_HotKey_Active);
}
}
protected override void WndProc(ref Message m)
{
if (m.Msg == 0x0312) if(m.WParam.ToInt32() == tuyen_HotKey_Active)
{
// Do something here. I want Ctrl + Space keystroke to be
// unhandled here so that it can be seen by the system.
}
base.WndProc(ref m);
}