我用vc自己写了一个浏览器,但点击页面链接时系统还是调用了ie打开。
如何用自定义浏览器打开页面链接?

解决方案 »

  1.   

    自己搞定了。代码如下:
    void CYYBroswerView::OnNewWindow2(LPDISPATCH* ppDisp, BOOL* 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);   
        CYYBroswerView* pView = (CYYBroswerView*)pFrame->GetActiveView();   
    //Pass pointer of WebBrowser object.   
        pView->SetRegisterAsBrowser(TRUE);   
        *ppDisp = pView->GetApplication();         
    }