加载图片,Flash,脚本等C#停WebBrowser控件 [英] C# stop webbrowser control from loading images, flash, script, etc

查看:361
本文介绍了加载图片,Flash,脚本等C#停WebBrowser控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能停止载入网页浏览器/显示图像,动画,脚本等?

How can i stop the webbrowser from loading/displaying images, flash, script etc?

我发现这篇文章的处理它,但我不知道如何实现STDMETHODIMP CAtlBrCon ::调用功能

I found this article that deals with it, but i dont know how to implement that "STDMETHODIMP CAtlBrCon::Invoke" function

这是链接:<一个href=\"http://msdn.microsoft.com/en-us/library/aa770041%28VS.85%29.aspx#Controlling_Download_and_Execution\"相对=nofollow>文章

任何人都可以点我到正确的方向?

Can anyone point me into the right direction?

推荐答案

这个过程是这样的:

该控件调用web浏览器的在SynchDOCDOWNLOADCTLFLAG功能IOleControl.OnAmbientPropertyChange实施 HTTP://csexwb2.google$c$c.com/svn/trunk/cEXWB.cs 的通知关于ActiveX主机在内部环境属性的变化WebBrowser控件

The control calls the webbrowser's IOleControl.OnAmbientPropertyChange implementation in the SynchDOCDOWNLOADCTLFLAG function in http://csexwb2.googlecode.com/svn/trunk/cEXWB.cs to notify the webbrowser control about a change in ambient properties inside the ActiveX host.

该WebBrowser控件然后调用它的主机的IDispatch.Invoke执行查询更新的下载控制标志。

The the webbrowser control then calls its host's IDispatch.Invoke implementation to query for the updated download control flag.

主机的IDispatch.Invoke实施的DISPID_AMBIENT_DLCONTROL DISPID看起来像这样

The host's IDispatch.Invoke implementation for the DISPID_AMBIENT_DLCONTROL dispid looks like this

[DISPID(HTMLDispIDs.DISPID_AMBIENT_DLCONTROL)
公众诠释Idispatch_AmbiantDlControl_Invoke_Handler()
{
    返回(INT)m_DLCtlFlags;
}

[DispId(HTMLDispIDs.DISPID_AMBIENT_DLCONTROL)] public int Idispatch_AmbiantDlControl_Invoke_Handler() { return (int)m_DLCtlFlags; }

检查<一href=\"http://msdn.microsoft.com/en-us/library/aa770041%28VS.85%29.aspx#Controlling_Download_and_Execution\"相对=nofollow>控制下载并执行看到标志的列表,你可以使用改变浏览器的行为。

Check Controlling Download and Execution to see the list of flags you can use to change the behavior of the browser.

这篇关于加载图片,Flash,脚本等C#停WebBrowser控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆