Exemplo n.º 1
0
        private IntPtr HwndHook(IntPtr hwndm, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
        {
            switch (msg)
            {
            case Win32Api.MessageId.WM_HOTKEY:
            {
                switch (wParam.ToInt32())
                {
                case Win32Api.HotkeyId.OPEN_HOTKEY_ID:
                {
                    int vkey = ((int)lParam >> 16) & 0xFFFF;
                    if (vkey == Win32Api.KeyCodes.VK_SPACE)
                    {
                        MainWindowEnabledEvent.RaiseMainWindowEnabledEvent(this, true);
                    }

                    handled = true;
                    break;
                }

                case Win32Api.HotkeyId.PASTE_HOTKEY_ID:
                {
                    int vkey = ((int)lParam >> 16) & 0xFFFF;
                    if (vkey == Win32Api.KeyCodes.VK_V)
                    {
                        OpenPasteWindowEvent.RaiseOpenPasteWindowEvent(this);
                    }

                    handled = true;
                    break;
                }
                }

                break;
            }

            case Win32Api.MessageId.WM_CLIPBOARDUPDATE:
            {
                ClipboardUpdatedEvent.RaiseClipboardUpdatedEvent(this);
                break;
            }
            }

            return(IntPtr.Zero);
        }
Exemplo n.º 2
0
 private void ShowWindow()
 {
     MainWindowEnabledEvent.RaiseMainWindowEnabledEvent(this, true);
 }