如题,我希望在自己开发的浏览器(使用CHtmlView/IWebBrowser2)中截获文件下载事件,然后启用一个自己的下载程序去下载。通过BeforeNavigate2、NavigateComplete2、DocumentComplete判断URL文件类型信息是不行的,因为对于这种http://dl.pconline.com.cn/filedown.jsp?id=30948&dltypeid=1下载网址无能为力,甚至IDocHostUIHandler::TranslateUrl也无法得到重定向后的URL。
本以为DWebBrowserEvents2::FileDownload事件可以解决问题,可以发现我怎样也捕获不到这个事件,而其他的事件都可以捕获到。文档上说这是IE5.5支持的,我用的IE6.0应该也可以,但调了半天也从没发生过这个事件。
请大家指点一下,能给出建议的都有分!

解决方案 »

  1.   

    The IDownloadManager interface provides access to the method of a custom download manager object that Microsoft® Internet Explorer and WebBrowser applications use to download a file.
      

  2.   

    http://msdn.microsoft.com/workshop/browser/ext/overview/downloadmgr.asp
    Implementing a Custom Download Manager
      

  3.   

    Thanks!
    Would you please give me a example about that? The parameter "IMoniker *pmk" of the IDownloadManager::Download methord is a headche for me:( how to create a IMoniker from a URL? Use URL Moniker functions? It's a puzzle for me...