Re: How to change User Agent string frequently?
- From: "jiangsheng[MVP]" <sheng_jiang@xxxxxxxxxxxxxxxxxxx>
- Date: Sun, 22 Oct 2006 21:37:07 -0500
BOOL CWBHostView::OnAmbientProperty(COleControlSite* pSite,
DISPID dispid, VARIANT* pvar)
{
USES_CONVERSION;
// Change download properties - no java, no scripts...
if (dispid == DISPID_AMBIENT_DLCONTROL)
{
pvar->vt = VT_I4;
pvar->lVal = DLCTL_NO_SCRIPTS | DLCTL_NO_JAVA
| DLCTL_NO_RUNACTIVEXCTLS | DLCTL_NO_DLACTIVEXCTLS;
return TRUE;
}
// Change user agent for this web browser host during hyperlinks
if (dispid == DISPID_AMBIENT_USERAGENT)
{
CString strUserAgent("MyWebBrowserHost");
pvar->vt = VT_BSTR;
pvar->bstrVal = ::SysAllocString(T2OLE(strUserAgent));
return TRUE;
}
return CView::OnAmbientProperty(pSite, dispid, pvar);
}
--
Regards
Sheng Jiang
Microsoft Most Valuable Professional in Visual C++
http://www.jiangsheng.net
http://blog.joycode.com/jiangsheng/
<mladen074@xxxxxxxxx> ????
news:1161559670.287324.183070@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
I'm using:
UrlMkSetSessionOption(URLMON_OPTION_USERAGENT, UserAgent,
strlen(UserAgent), 0);
to set the User Agent string and it works. I'm simply using the
WebBrowser control to embed a little webbrowser functionality in my
app. but once I call UrlMkSetSessionOption() and change the user agent
string it cannot be changed with further calls :(
Can I anyhow change the user agent string multiple times?
Thanks in advance,
Mladen.
.
- Follow-Ups:
- Re: How to change User Agent string frequently?
- From: mladen074
- Re: How to change User Agent string frequently?
- References:
- How to change User Agent string frequently?
- From: mladen074
- How to change User Agent string frequently?
- Prev by Date: How to change User Agent string frequently?
- Next by Date: Re: start new IE7 tab
- Previous by thread: How to change User Agent string frequently?
- Next by thread: Re: How to change User Agent string frequently?
- Index(es):
Relevant Pages
|
|