hmmm i Hope you are familiar with how to actually use the WebBrowser control in a C# application,
Now i was thinking that since IWebBrowser2 interface derives from IDispatch you will already have the definition of IDispatch in ur project so you might be able to use that.
Also for the constants like the ones below you will have to use the VS.Net Object browser to see if they are exposed as enumerated types, otherwise you will have to look up the header files and hand code the values of these constants.
DLCTL_DLIMAGES, DLCTL_VIDEOS, and DLCTL_BGSOUNDS
DLCTL_NO_SCRIPTS and DLCTL_NO_JAVA
DLCTL_NO_DLACTIVEXCTLS and DLCTL_NO_RUNACTIVEXCTLS:
Main Topics
Browse All Topics





by: SijinPosted on 2003-01-03 at 00:42:01ID: 7660956
Well i guess you'll need to do the following
1. Code a class in C# that implements the IDispatch interface. You can either hand code the IDispatch interface declaration or use tlbimp on the .idl file that contains the definition for IDispatch.
2. In the class implementation you need to do what the MSDN article says ie. respond to the paticular code and
return a value which will disable images and scripting.
3. Now the tricky part is(or maybe not) how to set this class as the host of the webbrowser control, if by default the form in which you have hosted the webbrowser control is the host then your task is quite easy, simply make the Form implement IDispatch, otherwise you will have to look for a method that sets the host for the webbrowser control.
Let me know if you need any help on specific issues.