比如我用ShellExecute或WinExec或CreateProcess等来调用iexplore.exe程序打开一个IE浏览器窗口,但我希望打开的IE窗口没有菜单,没有ToolBar,没有地址栏 等等。

解决方案 »

  1.   

    IWebBrowser2* pIE = NULL;
       HRESULT hr;
       hr = CoCreateInstance(CLSID_InternetExplorer, NULL, CLSCTX_SERVER,
             IID_IWebBrowser2, (LPVOID*)&pIE); 
       if (SUCCEEDED(hr))      {
          pIE->put_Visible(TRUE);
          pIE->put_AddressBar(FALSE);
          pIE->put_MenuBar(FALSE);
          pIE->put_StatusBar(FALSE);
          pIE->put_ToolBar(FALSE);
          pIE->put_FullScreen(FALSE);
          COleVariant vtEmpty;
          CString strURL = "http://www.microsoft.com/mvp";
          BSTR bstrURL = strURL.AllocSysString();
          pIE->Navigate(bstrURL, &vtEmpty, &vtEmpty, &vtEmpty, &vtEmpty);
          ::SysFreeString(bstrURL);      
       }