protected override void WndProc(ref Message m) { if (m.Msg == 0x232) { Invalidate(); PerformLayout(); } if (m.Msg == 0x400 + 1) { SetForceFocus.SetForceForegroundWindow(m.HWnd); } base.WndProc(ref m); }
// Do forcibly Activate private void keyboardHook_KeyboardHooked(object sender, KeyboardHookedEventArgs e) { if ((ModifierKeys & Keys.Control) != Keys.Control) { return; } if (e.KeyCode != Keys.Q) { return; } WindowState = FormWindowState.Normal; SetForceFocus.PostMessage(new HandleRef(this, Handle), 0x400 + 1, (IntPtr)0, (IntPtr)0); }