下面使用DELPHI获得webbrowers 的滚动条位置的代码:
Delphi(Pascal) codevar
vElement: IHTMLElement2;
begin
if not Assigned(WebBrowser1.Document) then Exit;
vElement :=
(WebBrowser1.Document as IHTMLDocument3).documentElement as IHTMLElement2;
if not Assigned(vElement) then
vElement := (WebBrowser1.Document as IHTMLDocument2).Body as IHTMLElement2;
Edit2.Text := IntToStr(vElement.scrollTop);
end;那位朋友帮忙翻译成VC++的代码?
Delphi(Pascal) codevar
vElement: IHTMLElement2;
begin
if not Assigned(WebBrowser1.Document) then Exit;
vElement :=
(WebBrowser1.Document as IHTMLDocument3).documentElement as IHTMLElement2;
if not Assigned(vElement) then
vElement := (WebBrowser1.Document as IHTMLDocument2).Body as IHTMLElement2;
Edit2.Text := IntToStr(vElement.scrollTop);
end;那位朋友帮忙翻译成VC++的代码?
解决方案 »
- 如何动态获取 设备管理器中的 串口号?
- 基于MFC的多文档应用程序、选择了office风格(即Ribbon界面)后,属性页
- 关于VC IE编程问题
- 请问计算机博士的就业?
- 请教各位,如何用VC将.dat格式的数据文件(二进制)导入Oracle中?!谢谢!
- 窗口控件修改后报错的问题
- 能否设置vc让他只支持标准c语法
- 急!求用VC++做一个被VB调用的DLL例子及相关注意事项!
- win98,win2000 下网络编程有什么不同吗?
- 如何自己用 API 封装一个窗口类? wndpro 必须定义成 static ? MFC 是如何实现的?
- 超酷QQ界面源码,但不知道怎么配置?请赐教.谢谢!!!
- 传Google中国入股天际网
if (m_pWebBrowser2)
m_pWebBrowser2->get_Document((IDispatch **)&disp);
if(disp)
disp->QueryInterface(IID_IHTMLDocument3, (void**)&m_doc);
if (m_doc)
m_doc->documentElement(&pElement);
if(!pElement)
{
disp->QueryInterface(IID_IHTMLDocument2, (void**)&m_doc);
m_doc->get_body(&pElement);
}
int int_temp = pElement->scrollTop(); 问题是 IID_IHTMLDocument3包含在哪个头文件中
2、用VC7/VC8