void Run() { m_ie = new InternetExplorer(); Console.WriteLine("Visible: {0}", m_ie.Visible); m_ie.Visible = true; // DWebBrowserEvents2_NavigateComplete2EventHandler ncd; // ncd = new DWebBrowserEvents2_NavigateComplete2EventHandler(OnNavigateComplete); // m_ie.NavigateComplete2 += ncd; DWebBrowserEvents2_OnQuitEventHandler qd; qd = new DWebBrowserEvents2_OnQuitEventHandler(OnQuit); m_ie.OnQuit += qd; DWebBrowserEvents2_DocumentCompleteEventHandler dcd; dcd = new DWebBrowserEvents2_DocumentCompleteEventHandler(OnDocumentComplete); m_ie.DocumentComplete += dcd; Object o = null; string url = System.IO.Path.GetFullPath("../../frameset.html"); Console.WriteLine("Navigate({0})", url); m_ie.Navigate(url, ref o, ref o, ref o, ref o); m_quitEvent.WaitOne(); }
private void InitApp() { InitializeComponent(); // Navigate to a default help text NavigateUrl(null); UpdateEnvInfo(null, true); // Hook up the StatusTextChange event DWebBrowserEvents2_StatusTextChangeEventHandler eh_StatusTextChange = new DWebBrowserEvents2_StatusTextChangeEventHandler(StatusTextChange); webBrowser.StatusTextChange += eh_StatusTextChange; // Hook up the DocumentComplete event DWebBrowserEvents2_DocumentCompleteEventHandler eh_DocumentComplete = new DWebBrowserEvents2_DocumentCompleteEventHandler(DocumentComplete); webBrowser.DocumentComplete += eh_DocumentComplete; }
void AttachSink(InternetExplorer explorer, IBrowserEvents sink) { m_sink = sink; DWebBrowserEvents2_OnQuitEventHandler qd; qd = new DWebBrowserEvents2_OnQuitEventHandler(this.OnQuit); explorer.OnQuit += qd; DWebBrowserEvents2_DocumentCompleteEventHandler dcd; dcd = new DWebBrowserEvents2_DocumentCompleteEventHandler(this.OnDocumentComplete); explorer.DocumentComplete += dcd; /* * // 2.Fired when browser navigates to a new url * DWebBrowserEvents2_NavigateComplete2EventHandler ncd; * ncd = new DWebBrowserEvents2_NavigateComplete2EventHandler(this.OnDocumentComplete); * explorer.NavigateComplete2 += ncd; * * //3.Statusbar text changed event * DWebBrowserEvents2_StatusTextChangeEventHandler DStatusE * = new DWebBrowserEvents2_StatusTextChangeEventHandler(OnStatusTextChange); * explorer.StatusTextChange += DStatusE; * * //4.Fired when download progress is updated. * DWebBrowserEvents2_ProgressChangeEventHandler DProgressE * = new DWebBrowserEvents2_ProgressChangeEventHandler(OnProgressChange); * explorer.ProgressChange += DProgressE; * * //5.Command State change event * DWebBrowserEvents2_CommandStateChangeEventHandler DCommandE * = new DWebBrowserEvents2_CommandStateChangeEventHandler(OnCommandStateChange); * explorer.CommandStateChange += DCommandE; * * //6.DownLoad begin event * DWebBrowserEvents2_DownloadBeginEventHandler DDownLoadStartE * = new DWebBrowserEvents2_DownloadBeginEventHandler(OnDownloadBegin); * explorer.DownloadBegin += DDownLoadStartE; * * //7.DownLoad begin event * DWebBrowserEvents2_DownloadCompleteEventHandler DDownLoadEndE * = new DWebBrowserEvents2_DownloadCompleteEventHandler(OnDownloadComplete); * explorer.DownloadComplete += DDownLoadEndE; * * //8.Title Change event * DWebBrowserEvents2_TitleChangeEventHandler DTitleChangeE * = new DWebBrowserEvents2_TitleChangeEventHandler(OnTitleChange); * explorer.TitleChange += DTitleChangeE; * * //9.Property change event * DWebBrowserEvents2_PropertyChangeEventHandler DPropertyChangeE * = new DWebBrowserEvents2_PropertyChangeEventHandler(OnPropertyChange); * explorer.PropertyChange += DPropertyChangeE; * * //10.Before navigate event * DWebBrowserEvents2_BeforeNavigate2EventHandler DBeforeNavigateE * = new DWebBrowserEvents2_BeforeNavigate2EventHandler(OnBeforeNavigate2); * explorer.BeforeNavigate2 += DBeforeNavigateE; * * //12.Creating a new window event * DWebBrowserEvents2_NewWindow2EventHandler DNewWindowE * = new DWebBrowserEvents2_NewWindow2EventHandler(OnNewWindow2); * explorer.NewWindow2 += DNewWindowE; * * //13.Full Screen event * DWebBrowserEvents2_OnFullScreenEventHandler DFullScreenE * = new DWebBrowserEvents2_OnFullScreenEventHandler(OnFullScreen); * explorer.OnFullScreen += DFullScreenE; * * //14.Menubar change event * DWebBrowserEvents2_OnMenuBarEventHandler DMenuBarE * = new DWebBrowserEvents2_OnMenuBarEventHandler(OnMenuBar); * explorer.OnMenuBar += DMenuBarE; * * //15.Toolbar change event * DWebBrowserEvents2_OnToolBarEventHandler DToolBarE * = new DWebBrowserEvents2_OnToolBarEventHandler(OnToolBar); * explorer.OnToolBar += DToolBarE; * * //16.Visibility change event * DWebBrowserEvents2_OnVisibleEventHandler DOnVisibleE * = new DWebBrowserEvents2_OnVisibleEventHandler(OnVisible); * explorer.OnVisible += DOnVisibleE; * * //17.Threat Mode event * DWebBrowserEvents2_OnTheaterModeEventHandler DTheaterE * = new DWebBrowserEvents2_OnTheaterModeEventHandler(OnTheaterMode); * explorer.OnTheaterMode += DTheaterE; */ //} }
void SetAllEvents() { if (m_IExplorer != null) { //1.Navigate Complete event DWebBrowserEvents2_NavigateComplete2EventHandler ncd = new DWebBrowserEvents2_NavigateComplete2EventHandler(OnNavigateComplete); m_IExplorer.NavigateComplete2 += ncd; //2.Quit Event DWebBrowserEvents2_OnQuitEventHandler DQuitE = new DWebBrowserEvents2_OnQuitEventHandler(OnQuit); m_IExplorer.OnQuit += DQuitE; //3.Statusbar text changed event DWebBrowserEvents2_StatusTextChangeEventHandler DStatusE = new DWebBrowserEvents2_StatusTextChangeEventHandler(OnStatusTextChange); m_IExplorer.StatusTextChange += DStatusE; //4.Fired when download progress is updated. DWebBrowserEvents2_ProgressChangeEventHandler DProgressE = new DWebBrowserEvents2_ProgressChangeEventHandler(OnProgressChange); m_IExplorer.ProgressChange += DProgressE; //5.Command State change event DWebBrowserEvents2_CommandStateChangeEventHandler DCommandE = new DWebBrowserEvents2_CommandStateChangeEventHandler(OnCommandStateChange); m_IExplorer.CommandStateChange += DCommandE; //6.DownLoad begin event DWebBrowserEvents2_DownloadBeginEventHandler DDownLoadStartE = new DWebBrowserEvents2_DownloadBeginEventHandler(OnDownloadBegin); m_IExplorer.DownloadBegin += DDownLoadStartE; //7.DownLoad complete event DWebBrowserEvents2_DownloadCompleteEventHandler DDownLoadEndE = new DWebBrowserEvents2_DownloadCompleteEventHandler(OnDownloadComplete); m_IExplorer.DownloadComplete += DDownLoadEndE; //8.Title Change event DWebBrowserEvents2_TitleChangeEventHandler DTitleChangeE = new DWebBrowserEvents2_TitleChangeEventHandler(OnTitleChange); m_IExplorer.TitleChange += DTitleChangeE; //9.Property change event DWebBrowserEvents2_PropertyChangeEventHandler DPropertyChangeE = new DWebBrowserEvents2_PropertyChangeEventHandler(OnPropertyChange); m_IExplorer.PropertyChange += DPropertyChangeE; //10.Before navigate event DWebBrowserEvents2_BeforeNavigate2EventHandler DBeforeNavigateE = new DWebBrowserEvents2_BeforeNavigate2EventHandler(OnBeforeNavigate2); m_IExplorer.BeforeNavigate2 += DBeforeNavigateE; //11.Document complete event DWebBrowserEvents2_DocumentCompleteEventHandler DDocumentCompleteE = new DWebBrowserEvents2_DocumentCompleteEventHandler(OnDocumentComplete); m_IExplorer.DocumentComplete += DDocumentCompleteE; //12.Creating a new window event DWebBrowserEvents2_NewWindow2EventHandler DNewWindowE = new DWebBrowserEvents2_NewWindow2EventHandler(OnNewWindow2); m_IExplorer.NewWindow2 += DNewWindowE; //13.Full Screen event DWebBrowserEvents2_OnFullScreenEventHandler DFullScreenE = new DWebBrowserEvents2_OnFullScreenEventHandler(OnFullScreen); m_IExplorer.OnFullScreen += DFullScreenE; //14.Menubar change event DWebBrowserEvents2_OnMenuBarEventHandler DMenuBarE = new DWebBrowserEvents2_OnMenuBarEventHandler(OnMenuBar); m_IExplorer.OnMenuBar += DMenuBarE; //15.Toolbar change event DWebBrowserEvents2_OnToolBarEventHandler DToolBarE = new DWebBrowserEvents2_OnToolBarEventHandler(OnToolBar); m_IExplorer.OnToolBar += DToolBarE; //16.Visibility change event DWebBrowserEvents2_OnVisibleEventHandler DOnVisibleE = new DWebBrowserEvents2_OnVisibleEventHandler(OnVisible); m_IExplorer.OnVisible += DOnVisibleE; //17.Threat Mode event DWebBrowserEvents2_OnTheaterModeEventHandler DTheaterE = new DWebBrowserEvents2_OnTheaterModeEventHandler(OnTheaterMode); m_IExplorer.OnTheaterMode += DTheaterE; } }
public virtual void remove_DocumentComplete (DWebBrowserEvents2_DocumentCompleteEventHandler );