protected override void WndProc(ref Message m)
        {
            switch (m.Msg)
            {
                case WM_CLIPBOARDUPDATE:
                    var args = new ClipbardUpdatedEventArgs();
                    OnClipboardUpdated(args);
                    if (args.Handled) m.Result = IntPtr.Zero;
                    return;
                case WM_DESTROY:
#if DEBUG
                    Console.WriteLine("ClipboardMonitor: WM_DESTROY");
#endif
                    StopMonitor();
                    break;
                case WM_CLOSE:
#if DEBUG
                    Console.WriteLine("ClipboardMonitor: WM_CLOSE");
#endif
                    StopMonitor();
                    break;
            }

            base.WndProc(ref m);
        }
Beispiel #2
0
        protected override void WndProc(ref Message m)
        {
            switch (m.Msg)
            {
            case WM_CLIPBOARDUPDATE:
                var args = new ClipbardUpdatedEventArgs();
                OnClipboardUpdated(args);
                if (args.Handled)
                {
                    m.Result = IntPtr.Zero;
                }
                return;

            case WM_DESTROY:
#if DEBUG
                Console.WriteLine("ClipboardMonitor: WM_DESTROY");
#endif
                StopMonitor();
                break;

            case WM_CLOSE:
#if DEBUG
                Console.WriteLine("ClipboardMonitor: WM_CLOSE");
#endif
                StopMonitor();
                break;
            }

            base.WndProc(ref m);
        }
Beispiel #3
0
        protected virtual void OnClipboardUpdated(ClipbardUpdatedEventArgs args)
        {
            var handler = ClipboardUpdated;

            if (handler != null)
            {
                handler(args);
            }
        }
 protected virtual void OnClipboardUpdated(ClipbardUpdatedEventArgs args)
 {
     var handler = ClipboardUpdated;
     if (handler != null) handler(args);
 }