如何控制WEBBROWSER浏览器的滚动条的位置?
m_ie.Navigate(m_strIEAddr,NULL,NULL,NULL,NULL);
IHTMLDocument2 *pHTMLDoc ;
IHTMLWindow2 *pHTMLWnd ;
if(SUCCEEDED(pHTMLDoc = (IHTMLDocument2*)m_ie.GetDocument()))
{
CIewebbrowserDlg * pDlg = (CIewebbrowserDlg*)pHTMLDoc;
if(pHTMLWnd=(IHTMLWindow2*)pDlg->GetActiveWindow())
{
pHTMLWnd->scrollTo(500, 600);
}
}
或者:
m_ie.Navigate(m_strIEAddr,NULL,NULL,NULL,NULL);
IHTMLDocument2 *htmldoc = (IHTMLDocument2*)m_ie.GetDocument();
IHTMLWindow2 *pWin;
htmldoc->get_parentWindow(&pWin);
if(!pWin)pWin->scrollBy(100,200);
为什么运行时总是出错呢?