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

  • On-demand Event Event Date: September 10, 2014 Modern mobile applications connect systems-of-engagement (mobile apps) with systems-of-record (traditional IT) to deliver new and innovative business value. But the lifecycle for development of mobile apps is also new and different. Emerging trends in mobile development call for faster delivery of incremental features, coupled with feedback from the users of the app "in the wild." This loop of continuous delivery and continuous feedback is how the best mobile …

  • Java developers know that testing code changes can be a huge pain, and waiting for an application to redeploy after a code fix can take an eternity. Wouldn't it be great if you could see your code changes immediately, fine-tune, debug, explore and deploy code without waiting for ages? In this white paper, find out how that's possible with a Java plugin that drastically changes the way you develop, test and run Java applications. Discover the advantages of this plugin, and the changes you can expect to see …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds