在HtmLView中的 OnNewWindow2()事件是调用了哪个API? 在HtmLView中的 OnNewWindow2()事件是调用了哪个API?解决马上结帖。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在NewWindow2事件发生的时候给你一个机会处理它,你自己实现它,然后浏览器控件来调用OnNewWindow2.void CoieView::OnNewWindow2(LPDISPATCH* ppDisp, BOOL* Cancel){ //// TODO: Add your specialized code here and/or call the base class //CHtmlView::OnNewWindow2(ppDisp, Cancel); // Get a pointer to the application object. CWinApp* pApp = AfxGetApp(); // Get the correct document template. POSITION pos = pApp->GetFirstDocTemplatePosition(); CDocTemplate* pDocTemplate = pApp->GetNextDocTemplate( pos ); // Create a new frame. CFrameWnd* pFrame = pDocTemplate->CreateNewFrame( GetDocument(), (CFrameWnd*)AfxGetMainWnd() ); // Activate the frame. pDocTemplate->InitialUpdateFrame( pFrame, NULL ); CHtmlView* pView = (CHtmlView*)pFrame->GetActiveView(); // Pass pointer of WebBrowser object. pView->SetRegisterAsBrowser( TRUE ); *ppDisp = pView->GetApplication(); } http://www.csdn.net/develop/read_article.asp?id=10691 http://www.ahetc.gov.cn/cit/200209/53.doc http://www.frontfree.net/view/article_230.html 我要的是调用的API,不过还是谢谢。 控件布局通用解决方案 listen和accept的关系 多线程调用win32 dll的全局变量有干扰 解决必送高分! 如何在设备上下文中移出位图 类似WSASend()的WSAxxxx函数是同步还是异步模式? CSocket中的OnAccept的问题 关于 IOCP 的疑问 如何将一个类型转换的问题 这段代码杀毒转件当毒给杀了,.求救! _com_error _com_ptr_ _bstr_t _variant_t 这几个对象的详细含义及用法。 Num Lock的问题。详情请进来看看。 在已有的工程中,怎样把一个类的基类改为别的基类?
void CoieView::OnNewWindow2(LPDISPATCH* ppDisp, BOOL* Cancel)
{
//// TODO: Add your specialized code here and/or call the base class //CHtmlView::OnNewWindow2(ppDisp, Cancel);
// Get a pointer to the application object.
CWinApp* pApp = AfxGetApp(); // Get the correct document template.
POSITION pos = pApp->GetFirstDocTemplatePosition();
CDocTemplate* pDocTemplate = pApp->GetNextDocTemplate( pos ); // Create a new frame.
CFrameWnd* pFrame = pDocTemplate->CreateNewFrame(
GetDocument(),
(CFrameWnd*)AfxGetMainWnd() ); // Activate the frame.
pDocTemplate->InitialUpdateFrame( pFrame, NULL );
CHtmlView* pView = (CHtmlView*)pFrame->GetActiveView(); // Pass pointer of WebBrowser object.
pView->SetRegisterAsBrowser( TRUE );
*ppDisp = pView->GetApplication(); }