就是打开IE属性页时,默认激活的是安全页?

解决方案 »

  1.   

    WinExec("rundll32.exe   shell32.dll,Control_RunDLL   inetcpl.cpl,,1",0);
      

  2.   

    有时,你需要在应用程序中激起Internet Options" 控制面板小程序,该程序与IE的 View / Internet Options...菜单完全相同。
    使用ClassWizard,选择“Add Class...”按钮。选择“From a type library...”,浏览到systems32目录,选择SHDocVw.dll。选择IShellDispatch项,并选择OK。这将增加两个文件到你的工程文件中, shdocvw.cpp和shdocvw.h。 为外壳类定义了GUID:
    DEFINE_GUID(CLSID_Shell,0x13709620,0xc279,0x11ce,0xa4,0x9e,0x44,0x45,0x53,0x54,0x00,0x00);
    以及激起控制面板小程序的代码:
    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");