Ejemplo n.º 1
0
        protected void OnNewWindow3(ref object ppDisp, ref bool Cancel, uint dwFlags, string bstrUrlContext, string bstrUrl)
        {
            EventHandler <NewWindow3EventArgs> h = NewWindow3;
            NewWindow3EventArgs args             = new NewWindow3EventArgs(ref ppDisp, ref Cancel, dwFlags, bstrUrlContext, bstrUrl);

            if (null != h)
            {
                h(this, args);
            }

            /*IWebBrowser2 iwebBrowser2 = this.ActiveXInstance as IWebBrowser2;
             * IHTMLDocument2 ihtmlwindowObj = iwebBrowser2.Document as IHTMLDocument2;
             * if (ihtmlwindowObj!=null)
             * {
             *  IHTMLWindow2 window = ihtmlwindowObj.GetParentWindow();
             *  window.SetOpener(
             * }*/



            //Pass the cancellation chosen back out to the events
            //Pass the ppDisp chosen back out to the events
            Cancel = args.Cancel;
            ppDisp = args.PPDisp;
        }
Ejemplo n.º 2
0
 void BrowserTab_NewWindow3(object sender, NewWindow3EventArgs e)
 {
     if (Program.Conf.InterceptPopup) //any new window to be redirected internally?
     {
         NavigationControl.Instance.Path = e.Url.ToString();
         e.Cancel = true;
     }
 }
        protected void OnNewWindow3(ref object ppDisp, ref bool Cancel, uint dwFlags, string bstrUrlContext, string bstrUrl)
        {
            EventHandler<NewWindow3EventArgs> h = NewWindow3;
            NewWindow3EventArgs args = new NewWindow3EventArgs(ref ppDisp, ref Cancel, dwFlags, bstrUrlContext, bstrUrl);
            if (null != h)
            {
                h(this, args);
            }
            /*IWebBrowser2 iwebBrowser2 = this.ActiveXInstance as IWebBrowser2;
            IHTMLDocument2 ihtmlwindowObj = iwebBrowser2.Document as IHTMLDocument2;
            if (ihtmlwindowObj!=null)
            {
                IHTMLWindow2 window = ihtmlwindowObj.GetParentWindow();
                window.SetOpener(
            }*/



            //Pass the cancellation chosen back out to the events
            //Pass the ppDisp chosen back out to the events
            Cancel = args.Cancel;
            ppDisp = args.PPDisp;
        }