Howto: reset IE security zone settings programmatically

Internet Explorer 7 introduced the IInternetZoneManagerEx2 interface, which has a FixUnsecureSettings method to reset all security zone settings. Like all other IInternetZoneManager* interfaces, you can query this interface from the internet zone manager object:

IInternetZoneManagerEx2* pzoneManager=NULL;

HRESULT hr=CoCreateInstance(CLSID_InternetZoneManager ,NULL,CLSCTX_INPROC_SERVER,IID_IInternetZoneManagerEx2,(LPVOID*)&pzoneManager);
if(hr==S_OK && pzoneManager!=NULL)
{
hr=pzoneManager->FixUnsecureSettings();
}

There’s another CoInternetCreateZoneManager function to get the zone manager object’s IInternetZoneManager interface.

About Sheng Jiang 蒋晟

Microsoft MVP in Visual C , 2004- Forum moderator of the Visual C and .Net forums on CSDN Forum moderator of Chinese forums on Microsoft's MSDN forums
This entry was posted in enmsdn, Microsoft, Visual C++, Visual Studio, Webbrowser control and tagged , , . Bookmark the permalink.

One Response to Howto: reset IE security zone settings programmatically

  1. Pingback: Troubleshoot: Internet Explorer | C'est mon Wordpress.com

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s