private IntPtr HwndHook(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
        {
            const int WM_HOTKEY = 0x0312;

            if (msg == WM_HOTKEY)
            {
                int id     = wParam.ToInt32();
                var hotkey = _registeredHotkeys.FirstOrDefault(x => x.Id == id);

                if (hotkey != null)
                {
                    if (_requireActiveEveClient && !_windowHelper.IsEveClientActive())
                    {
                        handled = false;
                    }
                    else
                    {
                        var keyEventArgs = new HotkeyEventArgs(hotkey.Gesture);
                        HotkeyPressed?.Invoke(this, keyEventArgs);
                        handled = keyEventArgs.Handled;
                    }

                    if (!handled)
                    {
                        HotkeyNativeMethods.UnregisterHotKey(_handle, hotkey.Id);
                        KeyboardMessage.Send(hotkey.Gesture);
                        HotkeyNativeMethods.RegisterHotKey(_handle, hotkey.Id, hotkey.Modifiers, hotkey.VirtualKey);
                    }
                }
            }

            return(IntPtr.Zero);
        }
        public void UnregisterHotkey(KeyGesture gesture)
        {
            var hotkey = _registeredHotkeys.FirstOrDefault(x => x.Gesture == gesture);

            if (hotkey == null)
            {
                throw new ArgumentException("Hotkey not registered.");
            }

            HotkeyNativeMethods.UnregisterHotKey(_handle, hotkey.Id);

            _registeredHotkeys.Remove(hotkey);
        }