女童尼外套:编了一个浏览器,如何实现网页内点击链接,捕获该网址

来源:百度文库 编辑:高校问答 时间:2024/04/28 22:28:53
捕获该链接后,再进行处理
编程使用webbrower控件

在CMainFrame中重载OnPaint:
void CMainFrame::OnPaint()
{
CPaintDC dc(this); // device context for painting

// TODO: Add your message handler code here
CMyView* pV = (CMyView*)this->GetActiveView();

if (pV->m_isLoaded == FALSE)
{
return;
}
else
{
CRect rect;
pV->GetClientRect(&rect);
pV->ValidateRect(&rect);
}
// Do not call CFrameWnd::OnPaint() for painting messages
}

m_isLoaded是CMyView中定义的一个全局变量。在CMyView的构造函数中初始化为TRUE,说明是刚开始运行程序,在打开网页的时候m_isLoaded=FALSE,这样就能解决你所说的问题了。