Implementing "Internet Options" in Internet Explorer | CodeGuru

Implementing “Internet Options” in Internet Explorer

Here is some sample code that will invoke the "Internet Options" control panel applet. This dialog is the same one that is available via IE’s View / Internet Options… menu selection. Using the ClassWizard, select the "Add Class…" button. Select "From a type library…". Browse to the systems 32 directory and select SHDocVw.dll. Select the […]

Written By
CodeGuru Staff
CodeGuru Staff
Dec 6, 1998
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

Here is some sample code that will invoke the "Internet Options" control panel applet. This dialog is the same one that is available via IE’s
View / Internet Options… menu selection.

Using the ClassWizard, select the "Add Class…" button. Select
"From a type library…". Browse to the systems 32 directory and
select SHDocVw.dll. Select the IShellDispatch item and click on OK.
This will add two files to your project, shdocvw.cpp and shdocvw.h
Include shdocvw.h in the source file which is invoking the internet options.
Include Initguid.h in the source file which is invoking the internet
options.Define the GUID for the shell class:

DEFINE_GUID(CLSID_Shell,0x13709620,0xc279,0x11ce,0xa4,0x9e,0x44,0x45,0x53,0x54,0x00,0x00);

and some code to actually invoke the control panel applet…

IShellDispatch disp;
HRESULT sc;
sc = ::CoInitialize(NULL);
if (FAILED (sc))
{
	CString str;
	str.Format(_T("Failed to Initialize."));
	TRACE( str) ;
	return;
}

sc = ::CoCreateInstance( CLSID_Shell, NULL, CLSCTX_SERVER,
IID_IDispatch, (void**)&disp ) ;
if (FAILED (sc))
{
	CString str;
	str.Format(_T("Failed to create Instance :-( "));
	TRACE( str) ;
	return;
}

disp.ControlPanelItem("inetcpl.cpl");

These steps and code have been tested by starting with a new MFC app
wizard dialog based application.

Last updated: December 6, 1998

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.