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 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


Comments

  • ADDING A LANGUAGE TO THE LIST OF LANGUAGES SUPPORTED BY IE

    Posted by Legacy on 11/02/2003 12:00am

    Originally posted by: SUNDEEP

    HI,
    I WOULD LIKE TO ADD A LANGUAGE SUPPORTED BY IE THRIUGH JAVASCRIPT CODE.( TOOLS->GENERAL->LANGUAGES>EN-UK)
    CAN ANY ONE HELP ME..
    THANKS
    SUNDEEP

    Reply
  • Avoiding download of ZIP/EXE files in Server

    Posted by Legacy on 10/01/2003 12:00am

    Originally posted by: P.V.Narasimha Rao

    Hi,
    How can I avoid the .ZIP or .EXE files residing in the server, by directly giving the path in the browser's address bar if once i came to know the fullpath of file where it is in the server. For eg if i give the path in the browser like http://localhost/simpletest/file1.exe, it is starting to download. Plz help me in this regard.

    Thanks in Advance

    Reply
  • How to remove or disable back button in browser.

    Posted by Legacy on 09/23/2003 12:00am

    Originally posted by: Nalni Kanth

    How to remove or disable back button in browser.

    Reply
  • How to add an Button in the Existing IE Toolbar

    Posted by Legacy on 08/06/2003 12:00am

    Originally posted by: Manoj S P

    Hi Guys,
    
    

    I would like to know how we can add an button to the existing IE toolbar, using VB 6. And OnClick of the Button
    i want to change/Toggle the proxy Settings (ie, Use Proxy Server or Not). Can any one help me on this.

    Thanks in Advance..

    Manoj

    Reply
  • Ignore Client Certificate Request

    Posted by Legacy on 07/05/2003 12:00am

    Originally posted by: Hemang

    How to Ignore Client Certificate Request without user attention for https connection? I don't want certificate selection dialong box to be presented and IE automatically to consider Ignore for particular URL..How can I develope plug-in for the purpose?

    Reply
  • Controling favorites programatically

    Posted by Legacy on 04/10/2003 12:00am

    Originally posted by: vignesh

    how to add a URL/address to favorites programtically from asp pages??

    Reply
  • test

    Posted by Legacy on 03/18/2003 12:00am

    Originally posted by: test

    test

    Reply
  • How to change proxies!!!

    Posted by Legacy on 11/25/2002 12:00am

    Originally posted by: Jeremy Shum

    Does any one know how to AUTOMATICALLY change the INTERNET EXPLORER's settings for PROXY SERVERS in VISUAL BASIC.

    So in Visual Basic, you can type in a text box the proxy server you want to have, and it can automatically change in the internet explorer settings, without opening internet explore's setting window. And if internet explore's settings are disabled.

    Reply
  • how can I get the handle of a running IE

    Posted by Legacy on 10/14/2002 12:00am

    Originally posted by: zhua1547

    I am a chinese,my English is not good!
    
    I can open IE by following code:
    ShellExecute(NULL,"open","http://www.google.com";,NULL,NULL,SW_SHOWNORMAL);

    but when I try to close the IE window just I opened before,I failed.


    Please tell me how to get the handle of a running IE by function FindWindow() or FindWindowEx()?

    Please tell me how to close IE window by funtion PostMessage()?

    Thanks a lot

    Reply
  • How can i restrict Copy and Printing command from asp Page

    Posted by Legacy on 07/26/2002 12:00am

    Originally posted by: Pushkar

    Reply
  • Loading, Please Wait ...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: November 20, 2014 @ 2:00 p.m. ET / 11:00 a.m. PT Are you wanting to target two or more platforms such as iOS, Android, and/or Windows? You are not alone. 90% of enterprises today are targeting two or more platforms. Attend this eSeminar to discover how mobile app developers can rely on one IDE to create applications across platforms and approaches (web, native, and/or hybrid), saving time, money, and effort and introducing apps to market faster. You'll learn the trade-offs for gaining long …

  • Live Event Date: October 29, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you interested in building a cognitive application using the power of IBM Watson? Need a platform that provides speed and ease for rapidly deploying this application? Join Chris Madison, Watson Solution Architect, as he walks through the process of building a Watson powered application on IBM Bluemix. Chris will talk about the new Watson Services just released on IBM bluemix, but more importantly he will do a step by step cognitive …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds