protected override void WndProc(ref Message m) { if (m.Msg == Messages.WM_CREATE) { this._clipboardViewer = new ClipboardViewer(this.Handle); this._clipboardViewer.ClipboardUpdated += (object sender, EventArgs e) => { this.ClipbordUpdated?.Invoke(this, EventArgs.Empty); }; WindowsFunctions.RegisterHotKey(this.Handle, 0, 1, (int)Keys.C); this._StartTrickTimer(23); } else if (this._clipboardViewer != null) { this._clipboardViewer.HandleWindowsMessage(m.Msg, m.WParam, m.LParam); } if (m.Msg == Messages.WM_HOTKEY) { Keys key = (Keys)(((int)m.LParam >> 16) & 0xFFFF); var modifier = (ModifierKeys)((int)m.LParam & 0xFFFF); if (key == Keys.C && modifier == System.Windows.Input.ModifierKeys.Alt) { this.Activate(); } } if (m.Msg == Messages.WM_QUERYENDSESSION) { this.Exit(); } base.WndProc(ref m); }