private void OnHotkeyPressed(object sender, HotkeyEventArgs e) { if (e.Hotkey == GetFocusHotkey(_window)) { if (_window.IsActive) { WindowSwitcher.ActivateNextWindow(_window); } else { _window.Activate(); } } }
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); }
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; }