Exemplo n.º 1
0
        /// <summary>
        ///     Sets the hook for the clipboard copy event.
        /// </summary>
        public void StartCapture(IClipboardWindowMessageSink windowMessageSink, INativeClipboard nativeClip)
        {
            clipboardWindowMessageSink = windowMessageSink;
            nativeClipboard            = nativeClip;

            if (clipboardWindowMessageSink == null)
            {
                return;
            }

            clipboardWindowMessageSink.ClipboardUpdated += OnClipboardUpdate;
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Sets the hook for the clipboard cut event.
        /// </summary>
        public void StartCapture(IClipboardWindowMessageSink windowMessageSink, INativeClipboard nativeClip)
        {
            clipboardWindowMessageSink = windowMessageSink;
            nativeClipboard            = nativeClip;

            if (clipboardWindowMessageSink == null)
            {
                return;
            }

            clipboardWindowMessageSink.ClipboardUpdated += OnClipboardUpdate;

            GlobalHook.IsActive = true;
            GlobalHook.AddListener(GlobalHookCallBack, GlobalHook.MessageType.WM_CUT);
        }