Click here to Skip to main content
13,409,230 members (42,418 online)
Click here to Skip to main content
Add your own
alternative version


35 bookmarked
Posted 28 Nov 2006

Launch and control MSIE using IWebBrowser2

, 28 Nov 2006
Rate this:
Please Sign up or sign in to vote.
A simple interface for launching MSIE and controlling IE components.

Sample output


This bit of sample code shows you how to use COM to launch Internet Explorer and through the browser's COM interface control aspects of the browser's interface such as the size of the window, turning on and off the menu bar, the tool bar, and the status bar, and changing the window's icon from the standard Internet Explorer icon to one of your choosing. It also spins IE off in a separate thread from the main thread of the application, and shows you how to determine the browser's version number via the registry.

Using the code

The only thing you should need to use this code is the LaunchBrowser.cpp file, and the prototype "spawn_browser" from that file. In addition, you will need to compile your project with the multi-threaded version of the runtime libraries. I've included a simple console app that shows how to use the interface and call the spawn_browser() function:

spawn_browser("", 800, 600, hIcon);

Points of Interest

The thread that actually performs the COM interface activity and manipulates the IWebBrowser2 interface is pretty well documented and easy to understand.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
United States United States
John Klein is an experienced C/C++ and C# developer with an emphisis on WiFi and 802.11 systems. John has 19 years of development and management experience and participated in the development of the IEEE 802.11 wireless protocol.

John currently works at JiWire, Inc. as a principal engineer.

You may also be interested in...


Comments and Discussions

QuestionWhy Pin
BMW74015-Jan-09 3:40
memberBMW74015-Jan-09 3:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.180221.1 | Last Updated 28 Nov 2006
Article Copyright 2006 by klein_jr
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid