AfxMessageBox((LPCTSTR)hMem);
::GlobalUnlock(hMem);
::GlobalFree(hMem);
hr = pPersistStream->Release();
pStream->Release();
}
2.implementing the "View Source" option in Internet Explorer
CWnd* pwndShell = m_WebBrowser2.GetWindow(GW_CHILD); // get the webbrowser window pointer
if (pwndShell)
{
pWnd = pwndShell->GetWindow(GW_CHILD); //get the child window pointer
}
if(pWnd != NULL)
{
WPARAM wParam = MAKELONG(IDM_VIEWSOURCE, 1); //convert to unsigned 32 bit value and pass it to WPARAM
pWnd->SendMessage(WM_COMMAND, wParam, (LPARAM)pWndHTML->m_hWnd); //cool send a message to retreive the source.
}
}
http://www.vckbase.com/document/上面的一篇文章