protected override void OnHandleCreated(EventArgs e)
        {
            base.OnHandleCreated(e);

            User32.SetParent(Handle, (IntPtr)User32.HwndMessage);
            User32.AddClipboardFormatListener(Handle);
        }
示例#2
0
            // on load: (hide this window)
            protected override void SetVisibleCore(bool value)
            {
                CreateHandle();

                mInstance = this;

                bool b = User32.AddClipboardFormatListener(mInstance.Handle);

                base.SetVisibleCore(false);
            }
示例#3
0
        protected override void OnSourceInitialized(EventArgs e)
        {
            base.OnSourceInitialized(e);
            Handle = new WindowInteropHelper(this).Handle;
            HwndSource source = PresentationSource.FromVisual(this) as HwndSource;

            source?.AddHook(new HwndSourceHook(WndProcHook));
            // Clipboard
            User32.AddClipboardFormatListener(Handle);
        }
示例#4
0
 public bool RegisterClipboardListener()
 {
     if (Environment.OSVersion.Version.Major < 6)
     {
         m_bCallingSetClipboardViewer = true;
         hwndNextViewer = User32.SetClipboardViewer(this.Handle);
         m_bCallingSetClipboardViewer = false;
         if (hwndNextViewer != IntPtr.Zero)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(User32.AddClipboardFormatListener(this.Handle));
     }
 }
示例#5
0
 void RegisterWin32()
 {
     User32.AddClipboardFormatListener(Handle);
 }