다음을 통해 공유


Working with WebBrowser Events (Windows CE 5.0)

Send Feedback

The WebBrowser control sends a number of different events to notify an application of user-generated activity. The events are implemented using the DWebBrowserEvents2 interface. When the control is about to navigate to a new location, it sends a DWebBrowserEvents2::BeforeNavigate2 event, specifying the URL or path of the new location and any other data that will be transmitted to the Internet server through the http transaction. The data can include the http header, http post data, and the URL of the referrer. The event also includes a cancel flag. After it has navigated to a new location, the WebBrowser control sends the DWebBrowserEvents2::NavigateComplete2 event. This event includes the same information as DWebBrowserEvents2::BeforeNavigate2, except that it does not include the cancel flag.

When the WebBrowser control is about to begin a download operation, it sends the DWebBrowserEvents2::DownloadBegin event. The control sends a number of DWebBrowserEvents2::ProgressChange events as the operation progresses. When the operation is complete it sends the DWebBrowserEvents2::DownloadComplete event. Applications typically use these three events to indicate the progress of the download operation, often by displaying a progress bar. An application would show the progress bar in response to DWebBrowserEvents2::DownloadBegin, update the progress bar in response to DWebBrowserEvents2::ProgressChange, and hide it in response to DWebBrowserEvents2::DownloadComplete.

When an application calls the IWebBrowser2::Navigate method with the Flags parameter set to navOpenInNewWindow, the WebBrowser control sends the DWebBrowserEvents2::NewWindow2 event before navigating to the new location. The event includes information about the new location and a flag that indicates whether the application or the control is to create the new window. Set this flag to TRUE if your application will create the window or to FALSE if the WebBrowser control should create it.

See Also

Internet Explorer Browser Control Host Application Development

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.