Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
inet
active_desktop
active_scrptng
asp.components
asp.db
asp.general
comctl32
comp.packaging
components.dev
dbweb
dhtml_editing
docobjects
html_authoring
html_objmodel
iis
iis.ftp
iis.security
iis.smtp_nntp
indexserver
misc
mshtml_hosting
scripting.jscript
scripting.vbscript
sdk_setup
shell_objmodel
urlmonikers
webbrowser_ctl
wininet
  
 
date: Mon, 7 Jul 2008 20:58:44 -0700,    group: microsoft.public.inetsdk.programming.webbrowser_ctl        back       


DISPID_FILEDOWNLOAD url of file that is about to be downloaded   
Hi,

BHO programming: how go I get the full URL of the file being downloaded? 
get_LocationURL gets the address bar URL as it should, but I need the URL of 
the resource that is about to be downloaded. See code below

TECH

//=======================
STDMETHODIMP CMytestClass::Invoke(DISPID dispidMember, REFIID riid, LCID 
lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pvarResult, EXCEPINFO 
*pExcepInfo, UINT *puArgErr)
{
     HRESULT hr = S_OK;
     BSTR bstrUrlName;
     BSTR bstrDownloadFileName;

// check if downloads are blocked
if(dispidMember == DISPID_FILEDOWNLOAD)
 {
  BSTR bstrUrlName;
  HRESULT hr = m_spWebBrowser2->get_LocationURL(&bstrUrlName);
bstrDownloadFileName ???
date: Mon, 7 Jul 2008 20:58:44 -0700   author:   Tech

Re: DISPID_FILEDOWNLOAD url of file that is about to be downloaded   
"Tech"  wrote in message
news:uvoao7K4IHA.220@TK2MSFTNGP02.phx.gbl
> BHO programming: how go I get the full URL of the file being
> downloaded?

I believe you should have received BeforeNavigate2 event right before 
FileDownload, complete with the URL.

Perhaps you may want to implement IDownloadManager instead.
-- 
With best wishes,
    Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925
date: Tue, 8 Jul 2008 07:41:48 -0400   author:   Igor Tandetnik

Re: DISPID_FILEDOWNLOAD url of file that is about to be downloaded   
>I believe you should have received BeforeNavigate2 event right before 
>FileDownload, complete with the URL.
No this is not the case (IE 6 + XP at least), I have seen a similar reply in 
this group. BeforeNavigate2 returns the same URL that is in the address bar 
(when navigating via hyperlink)

> Perhaps you may want to implement IDownloadManager instead.
Will check it out, thank you!

TECH

"Igor Tandetnik"  wrote in message 
news:%23zymd%23O4IHA.3396@TK2MSFTNGP02.phx.gbl...
> "Tech"  wrote in message
> news:uvoao7K4IHA.220@TK2MSFTNGP02.phx.gbl
>> BHO programming: how go I get the full URL of the file being
>> downloaded?
>
> I believe you should have received BeforeNavigate2 event right before 
> FileDownload, complete with the URL.
>
> Perhaps you may want to implement IDownloadManager instead.
> -- 
> With best wishes,
>    Igor Tandetnik
>
> With sufficient thrust, pigs fly just fine. However, this is not 
> necessarily a good idea. It is hard to be sure where they are going to 
> land, and it could be dangerous sitting under them as they fly 
> overhead. -- RFC 1925
>
date: Tue, 8 Jul 2008 11:52:08 -0700   author:   Tech

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us