void __fastcall TReadMainForm::SetLastScrollTop(int iScrollTop)<br>{<br> //TODO:设置当前浏览的位置。<br> IHTMLDocument2 *HTMLDocument = NULL;<br> IHTMLWindow2 *pHtmlWin = NULL;<br> //IHTMLPaintSite *pHTMLPaintSite = NULL;<br><br> VARIANT vScrollTop; <br><br> _di_IDispatch WebDocument = CppWebBrowser1->Document;<br> IDispatch * WebDocument1 = static_cast<IDispatch *>(WebDocument);<br> HTMLDocument = static_cast<IHTMLDocument2 *>(WebDocument1);<br> HTMLDocument->get_parentWindow(&pHtmlWin);<br> //WebDocument->QueryInterface(IID_IHTMLPaintSite ,(void**)&pHTMLPaintSite);<br><br> if(pHtmlWin)<br> {<br> pHtmlWin->scrollBy(0,iScrollTop);<br> }<br>}<br>//---------------------------------------------------------------------------