我目前常采用的方案主要有两种
1:知道url的情况下
DocumentComplete事件中
判断url 是否等于m_Brow.GetLoctalUrl()
如果相等则表示加载完成
2:不知道url的情况下
BeforeNavigate2事件中记录第一次到来的指针
if (!g_pDisp)
{
g_pDisp = pDisp;
}
然后再DocumentComplete中进行比较
if (pDisp == g_pDisp)
{
SetWindowText("完成");
}
本文介绍了两种检测网页加载完成的方法:一是已知URL时,在DocumentComplete事件中通过比较URL来判断;二是未知URL时,利用BeforeNavigate2事件记录指针,并在DocumentComplete中对比判断。
我目前常采用的方案主要有两种
1:知道url的情况下
DocumentComplete事件中
判断url 是否等于m_Brow.GetLoctalUrl()
如果相等则表示加载完成
2:不知道url的情况下
BeforeNavigate2事件中记录第一次到来的指针
if (!g_pDisp)
{
g_pDisp = pDisp;
}
然后再DocumentComplete中进行比较
if (pDisp == g_pDisp)
{
SetWindowText("完成");
}

被折叠的 条评论
为什么被折叠?