Ejemplo n.º 1
0
 private void OnHotkeyPressed(object sender, HotkeyEventArgs e)
 {
     if (e.Hotkey == GetFocusHotkey(_window))
     {
         if (_window.IsActive)
         {
             WindowSwitcher.ActivateNextWindow(_window);
         }
         else
         {
             _window.Activate();
         }
     }
 }
Ejemplo n.º 2
0
        private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
        {
            const int WM_HOTKEY = 0x312;

            if (msg == WM_HOTKEY)
            {
                int id = wParam.ToInt32();

                if (_entries.ContainsKey(id))
                {
                    HotkeyEventArgs e = new HotkeyEventArgs(_entries[id].Hotkey);
                    HotkeyPressed(this, e);

                    handled = true;
                }
            }

            return(IntPtr.Zero);
        }
Ejemplo n.º 3
0
 private void OnHotkeyPressed(object sender, HotkeyEventArgs e)
 {
     if (e.Hotkey == GetFocusHotkey(_window))
     {
         if (_window.IsActive)
         {
             WindowSwitcher.ActivateNextWindow(_window);
         }
         else
         {
             _window.Activate();
         }
     }
 }
Ejemplo n.º 4
0
        private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
        {
            const int WM_HOTKEY = 0x312;

            if (msg == WM_HOTKEY)
            {
                int id = wParam.ToInt32();

                if (_entries.ContainsKey(id))
                {
                    HotkeyEventArgs e = new HotkeyEventArgs(_entries[id].Hotkey);
                    HotkeyPressed(this, e);

                    handled = true;
                }
            }

            return IntPtr.Zero;
        }