示例#1
0
 private void AttachInterceptorToChromiumBrowser()
 {
     Task.Factory.StartNew(() =>
     {
         try
         {
             while (true)
             {
                 IntPtr chromeWidgetHostHandle = IntPtr.Zero;
                 if (BrowserWidgetHandleFinder.TryFindHandle(BrowserHandle, out chromeWidgetHostHandle))
                 {
                     messageInterceptor = new BrowserWidgetMessageInterceptor(browser, chromeWidgetHostHandle, OnWebBroswerMessage);
                     break;
                 }
                 else
                 {
                     System.Threading.Thread.Sleep(0);
                 }
             }
         }
         catch
         {
         }
     });
 }
示例#2
0
文件: HtmlUIForm.cs 项目: wxjwz/NanUI
        //protected override void OnMouseDown(MouseEventArgs e)
        //{
        //	base.OnMouseDown(e);

        //	if (Resizable && ResizeDirection != HitTest.HTNOWHERE)
        //	{
        //		User32.SendMessage(Handle, (uint)WindowsMessages.WM_NCLBUTTONDOWN, (IntPtr)ResizeDirection, (IntPtr)0);
        //		User32.InvalidateWindow(Handle);
        //	}
        //}
        protected override void OnClosed(EventArgs e)
        {
            messageInterceptor?.ReleaseHandle();
            messageInterceptor?.DestroyHandle();
            messageInterceptor = null;


            browser.Dispose();

            base.OnClosed(e);
        }
示例#3
0
        protected override void OnClosed(EventArgs e)
        {
            messageInterceptor?.ReleaseHandle();
            messageInterceptor?.DestroyHandle();
            messageInterceptor = null;


            base.OnClosed(e);

            nativeForm?.ReleaseHandle();
            nativeForm?.DestroyHandle();
        }
示例#4
0
        protected void Dispose()
        {
            if (messageInterceptor != null)
            {
                messageInterceptor.ReleaseHandle();

                messageInterceptor.DestroyHandle();
            }

            messageInterceptor = null;

            if (nativeForm != null)
            {
                nativeForm.ReleaseHandle();
                nativeForm.DestroyHandle();
            }
        }
示例#5
0
        protected override void OnClosed(EventArgs e)
        {
            if (messageInterceptor != null)
            {
                messageInterceptor.ReleaseHandle();

                messageInterceptor.DestroyHandle();
            }

            messageInterceptor = null;


            base.OnClosed(e);

            if (nativeForm != null)
            {
                nativeForm.ReleaseHandle();
                nativeForm.DestroyHandle();
            }
        }