在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,不过还是谢谢。 CRichEditCtrl内容生成位图问题 串口与单片机通讯的问题 MFC中含webbrowser2多线程窗口的实现 怎么修改 ListCtrl中 CheckBox的大小呢? 大家也遇到过吧十分困扰 谁帮个忙 VC中的结构体指针,作为某个函数的参数,或是返回值,在java中如何实现?? 如何让托盘(通知区)图标闪动? 请给一个优秀的解决生产者-消费者模型的问题的sdk代码,都怪我,操作系统没有好好学 一个WND的消息问题 如何操作其他窗口的控件?---请高手指点 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(); }