Creating an Internet Browser
Other versions of this page are also available for the following:
8/28/2008
** Windows Embedded CE includes sample browser applications that provide a base for creating an Internet Browser. You can use the IESample browser application as is, or you can modify the source code to add or remove functionalities. Or, you can use the IESimple sample application to create a browser application that also provides a windowless or a full-screen mode. For more information about these samples, see Internet Explorer 6 Samples.**
Follow these steps to create a simple full-screen browser by using the WebBrowser control that adds browsing, document viewing, and data downloading capabilities to your applications. For more information about the WebBrowser Control, see this Microsoft Web site.
Procedures
To create an Internet browser:
Create a class for your browser. For more information, see Creating a Browser Class.
Register the browser window. For more information, see Registering the Browser Window.
Create a window to hold the browser work area by implementing the IWebBrowser2 interface. For more information, see Creating a Web Browser Object.
Set up the event sink by finding the DWebBrowserEvents2 connection point on the IWebBrowser2 object that was created in step 3, and then registering the event sinks. For more information, see Setting Up Event Sinks.
Write a method that performs browsing operation by using IWebBrowser2 methods such as Navigate2. For more information, see Navigating to a Specified URL.
In your browser application, set up an event loop to receive events from the browser. The following code example shows how to do this.
while (GetMessage( &msg, NULL, 0, 0 ) ) { if(msg.message == WM_QUIT) break; TranslateMessage(&msg); DispatchMessage(&msg); }
In This Section
- Creating a Browser Class
Describes how to define a class for the browser
- Registering the Browser Window
Describes how to register the browser window
- Creating a Browser Window
Explains how to create a window to provide a work area for the browser
- Creating a Web Browser Object
Describes how to create a Web browser object
- Setting Up Event Sinks
Describes how to register event sinks
- Navigating to a Specified URL
Describes how to use the browser to move to a specified URL