Beispiel #1
0
        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);
        }
Beispiel #2
0
        // 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);
        }