示例#1
0
        protected void OnNewWindow2(ref object ppDisp, ref bool cancel)
        {
            EventHandler <NewWindow2EventArgs> h = NewWindow2;
            NewWindow2EventArgs args             = new NewWindow2EventArgs(ref ppDisp, ref cancel);

            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;
        }
        protected void OnNewWindow2(ref object ppDisp, ref bool cancel)
        {
            EventHandler<NewWindow2EventArgs> h = NewWindow2;
            NewWindow2EventArgs args = new NewWindow2EventArgs(ref ppDisp, ref cancel);
            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;
        }