日韩黑丝制服一区视频播放|日韩欧美人妻丝袜视频在线观看|九九影院一级蜜桃|亚洲中文在线导航|青草草视频在线观看|婷婷五月色伊人网站|日本一区二区在线|国产AV一二三四区毛片|正在播放久草视频|亚洲色图精品一区

分享

OLECMDID

 liujian6916 2007-01-07
前天偶然發(fā)現(xiàn)m_Web.ExecWB(OLECMDID_SAVEAS,OLECMDEXECOPT_PROMPTUSER,&va_inVal,&va_outVal); 能夠調(diào)出ie的對(duì)話框,而且還可以保存為*.mht格式,但試盡了參數(shù),也沒(méi)法使對(duì)話框不被彈出而保存該文件為*.mht,請(qǐng)問(wèn)各位有什么高招?

A
IDM_SAVEAS Command ID

--------------------------------------------------------------------------------

Saves the current Web page to a file.

C++ Information

Command group CGID_MSHTML (defined in mshtmhst.h) 
Symbolic constant IDM_SAVEAS 
User interface Optional. This command displays a dialogue box if the nCmdExecOpt argument of IOleCommandTarget::Exec  is set to MSOCMDEXECOPT_DODEFAULT, MSOCMDEXECOPT_PROMPTUSER, or NULL. It does not display a dialogue box if the argument is set to MSOCMDEXECOPT_DONTPROMPTUSER.
IOleCommandTarget::Exec parameters pvaIn VARIANT of type VT_BSTR that specifies the path and file name of the file to which to save the Web page. When the path contains more than one folder name, separate the folder names with two backward slashes (\\).
pvaOut Set to NULL.
 
Header file mshtmcid.h 
Applies to IHTMLDocument2::execCommand, IHTMLDocument2::queryCommandEnabled, IHTMLDocument2::queryCommandIndeterm, IHTMLDocument2::queryCommandState, IHTMLDocument2::queryCommandSupported, IHTMLDocument2::queryCommandValue, emit_hlink;, IOleCommandTarget::QueryStatus . 

保存到一個(gè).mht文件,并且設(shè)置DONTPROMPTUSER看看


Accomplishing this task from a Visual C++ host is very straightforward. You can use an IWebBrowser2 interface to call the QueryInterface method for the IHTMLDocument2 interface. After you obtain a pointer to the document, then call QueryInterface for the IPersistFile interface. After you obtain this interface pointer, you can call the save method to save the file to disk.

    HRESULT          hr    = E_FAIL;
    IDispatch*       pDisp = NULL;
    IHTMLDocument2*  pDoc  = NULL;
 
    pDisp                  = m_webOC.GetDocument();

   if(SUCCEEDED(hr = pDisp->QueryInterface(IID_IHTMLDocument2,(void**)&pDoc)))
   {
       IPersistFile* pFile = NULL;
       if(SUCCEEDED(pDoc->QueryInterface(IID_IPersistFile,(void**)&pFile)))
       {
 LPCOLESTR file = L"c:\\test1.mht";
 pFile->Save(file,TRUE);
       }
   }

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多