Web控件的使用及获取用户点击的链接地址
需要实现接口类public Osp::Web::Controls::ILoadingListener
__pWeb = new Web();
r = __pWeb->Construct(Rectangle(x, y, w, h));
TryCatch(r == E_SUCCESS, ,"Web is not constructed/n ");
r = __pMainForm->AddControl(*__pWeb);
TryCatch(r == E_SUCCESS, ,"Web is not attached/n ");
__pWeb->SetLoadingListener(this);
__pWeb->SetFocus();
__pWeb->LoadUrl(L"http://***");
在函数bool BrowserForm::OnLoadingRequested (const Osp::Base::String &url, WebNavigationType type)中就可以获取到所有访问的url,同时在函数DecisionPolicy BrowserForm::OnWebDataReceived (const Osp::Base::String &mime, const Osp::Net::Http::HttpHeader&httpHeader)中必须返回 WEB_DECISION_CONTINUE。
函数void BrowserForm::OnEstimatedProgress(int progress)可以获取到当前页面打开的百分比