调试Shell/IE的插件时须预先修改一下系统设置, 见<Debugging With the Shell>
解决方案 »
- vs2008里如何单步跟踪进行调试静态链接库?
- VC MapX添加图元
- 如何给从互联网给某台电脑发UDP数据报
- 你好
- 求《Visual C++数字图像识别技术典型案例》 电子版
- 请问如何实现改变Picture的背景颜色呢?
- 使用CAsyncSocket发送短信给另外一个CAsyncSocket服务器端,为什么第2次才能接收到信息
- 改变属性页的背景色,急,在线等候
- 新手!我不知道如何给分?
- 我用代码向toolbar中加了个按钮,为什么运行时确实无效的呢?我给它加了方法的!
- 请问如何实现类似winamp的皮肤功能(金山词霸2002也有的skins)??
- ====如何实现高性能的通讯模块???====
HKLM
{
SOFTWARE
{
Microsoft
{
Windows
{
CurrentVersion
{
Explorer
{
'Browser Helper Objects'
{
ForceRemove {DADF130D-84E2-46C3-9BE1-3298086F26A7}
}
}
}
}
}
}
}
DWORD m_dwCookie;
add this line to your Celf::SetSite(IUnknown *pUnkSite)
hr = spCP->Advise( reinterpret_cast<IDispatch*>(this), &m_dwCookie);
and modify your Invoke(...)
if (dispidMember == DISPID_NEWWINDOW2)
{
//Once you're connected to DWebBrowserEvents2, implement your IDispatch::Invoke so that
//it handles DISPID_NEWWINDOW2. During the IDispatch::Invoke function call for DISPID_NEWWINDOW2,
//the array pDispParams contains two parameters. The first one, at index zero, is a Boolean value
//that tells the WebBrowser Control whether to cancel the new window or not. By default, it is
//FALSE and a new window will open. If you want to cancel new window creation completely,
//set the flag to TRUE.
//you have not passed pDispParams to OnNewWindow2, so I don't think that function can take effect. You can change pDispParams here directly, not using your OnNewWindow2
}
那么又怎样可以将值传给OnNewWindow2中的第二个参数?
pDispParams->rgvarg[0].boolVal=TRUE;
到
if (dispidMember == DISPID_NEWWINDOW2){
的下面,但不行,运行IE时仍弹出广告窗口。
{
if (dispidMember == DISPID_NEWWINDOW2)
{
if(bAD)
{
*V_BOOLREF(&pDispParams->rgvarg[0]) = VARIANT_TRUE;
}
else
{
*V_BOOLREF(&pDispParams->rgvarg[0]) = VARIANT_FALSE;
}
}
}