Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

Suppress download dialog that appears using IWebBrowser2 interface

$
0
0

I am trying to download resources from web server using IWebBrowser2 interface. API Navigate2 is used to download resources. However as soon as the download begins I get a prompt as shown in figure.

Sample code snippet is as give below:

void MyNavigate(CString &strURL)
{
//strURL contains the actual URL path of resource to be downloaded.

//m_pWebBrowser2 is an instance of type IWebBrowser2*

HRESULT hr = S_OK;
DWORD dwFlags = 0;
LPCTSTR lpszTargetFrameName = NULL;
LPCTSTR lpszHeaders = NULL;
LPVOID lpvPostData = NULL;
DWORD dwPostDataLen = 0;
COleSafeArray vPostData;
COleVariant vaURL(strURL);

if(m_pWebBrowser2 != NULL)
{
hr = m_pWebBrowser2->Navigate2(vaURL, COleVariant((long) dwFlags, VT_I4), COleVariant(lpszTargetFrameName, VT_BSTR), vPostData, COleVariant(lpszHeaders, VT_BSTR));
}

}
I wish to download resources without giving any prompt to users. Any insights as to how to achieve it are appreciated.

Sumeet Bhatia --- [India]


Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>