do
{
CComQIPtr<IHTMLDocument2> spHTMLDocument;
CComPtr<IDispatch> spDispDoc;
HRESULT hr = _webBrowser2->get_Document(&spDispDoc);
if (FAILED(hr) || !spDispDoc)
{
CC_BREAK_IF(FAILED(hr));
}
hr = spDispDoc->QueryInterface(&spHTMLDocument);
if (FAILED(hr) || !spHTMLDocument)
{
CC_BREAK_IF(FAILED(hr));
}
CComQIPtr<IHTMLElement> spElement;
CComQIPtr<IHTMLBodyElement> spBodyElement;
if (SUCCEEDED(spHTMLDocument->get_body(&spElement)) && spElement)
{
if (SUCCEEDED(spElement->QueryInterface(IID_IHTMLBodyElement, (void **)&spBodyElement)))
{
spBodyElement->put_scroll(L"no");
}
}
} while (false);
Cocos2dx Win32嵌入网页源码: