H
Hed
Unregistered / Unconfirmed
GUEST, unregistred user!
找到了资料只有这个
============================================
if WebBrowser1.Document <> nil then
IHTMLWindow4(WebBrowser1.Document).focus
还有,需要判断文档是否获得焦点这样来做:
if IHTMLWindow4(WebBrowser1.Document).hasfocus then
===========================================
根据以上的资料,我的代码如下:
if (WebBrowser1.Document <> nil) and (IHTMLWindow4(WebBrowser1.Document).hasfocus) then
IHTMLWindow2(IHTMLDocument2(WebBrowser1.Document).ParentWindow).focus
但编译不过去,错误在IHTMLWindow4(WebBrowser1.Document).hasfocus
找不到IHTMLWindow4的声明,我在mshtml单元中也未找到IHTMLWindow4的声明,请大家帮忙给解答一下.有什么办法能够获得WebBrowser控件焦点状态.
============================================
if WebBrowser1.Document <> nil then
IHTMLWindow4(WebBrowser1.Document).focus
还有,需要判断文档是否获得焦点这样来做:
if IHTMLWindow4(WebBrowser1.Document).hasfocus then
===========================================
根据以上的资料,我的代码如下:
if (WebBrowser1.Document <> nil) and (IHTMLWindow4(WebBrowser1.Document).hasfocus) then
IHTMLWindow2(IHTMLDocument2(WebBrowser1.Document).ParentWindow).focus
但编译不过去,错误在IHTMLWindow4(WebBrowser1.Document).hasfocus
找不到IHTMLWindow4的声明,我在mshtml单元中也未找到IHTMLWindow4的声明,请大家帮忙给解答一下.有什么办法能够获得WebBrowser控件焦点状态.