在HtmLView中的 OnNewWindow2()事件是调用了哪个API?解决马上结帖。

解决方案 »

  1.   

    在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();   }
      

  2.   

    http://www.csdn.net/develop/read_article.asp?id=10691
      

  3.   

    http://www.ahetc.gov.cn/cit/200209/53.doc
      

  4.   

    http://www.frontfree.net/view/article_230.html
      

  5.   

    我要的是调用的API,不过还是谢谢。