在c:\winnt\system32\下有一个InetCpl.cpl控制面板扩展程序,你调用它就可以了,可以参考有关控制面板扩展程序方面的资料

解决方案 »

  1.   

    以下是我参考MyIE代码的程序,可以直接用:
    HRESULT CMainFrame::ExecCmdTarget(DWORD nCmdID, CHtmlView *pHtmlView)
    {
    LPDISPATCH lpDispatch = NULL;
        LPOLECOMMANDTARGET lpOleCommandTarget = NULL; if(pHtmlView != NULL)
    {
    try
    {
    lpDispatch = pHtmlView->GetHtmlDocument();
    if(lpDispatch == NULL)
    return S_OK;
    ASSERT(lpDispatch); // Get an IDispatch pointer for the IOleCommandTarget interface.
    lpDispatch->QueryInterface(IID_IOleCommandTarget, (void**)&lpOleCommandTarget);
    ASSERT(lpOleCommandTarget); lpDispatch->Release();
    lpDispatch = NULL; // Invoke the given command id for the WebBrowser control
    if(lpOleCommandTarget != NULL)
    {
    HRESULT hr = lpOleCommandTarget->Exec(&CGID_IWebBrowser, 
    nCmdID, 0, NULL, NULL);
    lpOleCommandTarget->Release();
    lpOleCommandTarget = NULL;
    return hr;
    }
    else
    return S_OK;
    }
    catch(...)
    {
    // if(lpDispatch != NULL)
    // lpDispatch->Release();
    // if(lpOleCommandTarget != NULL)
    // lpOleCommandTarget->Release();
    }
    }
    return S_OK;
    }// 菜单查看/Internet选项的响应函数:显示Internet选项对话框
    void CMainFrame::OnViewInternetoptions() 
    {
    // TODO: Add your command handler code here
    try
    {
    CChildFrame *pChildFrame = (CChildFrame *)MDIGetActive();
    if (!pChildFrame)
    return;
    CHtmlView *pView = (CHtmlView *)pChildFrame->GetActiveView();
    if (!pView)
    return;
    ExecCmdTarget(HTMLID_OPTIONS, pView);
    }
    catch(...)
    {
    }
    }
      

  2.   

    http://www.codeguru.com/ieprogram/internet_options.shtml
      

  3.   

    //method1
    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(CString("inetcpl.cpl").AllocSysString());
    //method2
    //ShellExecute(0, "open", "control.exe", "inetcpl.cpl", ".", SW_SHOW);
    //method3
    //WinExec("control.exe inetcpl.cpl",SW_SHOW);