Question How do i stop vb webbrowser from displaying pictures

NeedHelp

Member
Joined
Jun 5, 2011
Messages
7
Programming Experience
3-5
I want the web browser to run much quicker:
To acheive this I would like to disable the vb webbrowser from displaying pictures.
I could not find a property to do this, within the vb browser settings
+ I would rather not have to fiddle with computer's regisrty files.

Thank you in advance for help with this
 
WebBrowser Customization
you need to implement your host's IDispatch so it handles DISPID_AMBIENT_DLCONTROL
Various codes are found on the web that does this and much other stuff, and it is often complex with lots of unmanaged interface definitions. The key implementation for VB.Net is to cast ActiveXInstance to IOleObject and call SetClientSite method, pointing to a IOleClientSite class with a method marked DispId(DISPID_AMBIENT_DLCONTROL) that return the ambient flags. I found that Microsoft.VisualStudio_OLE.Interop.dll assembly registered in GAC had the necessary OLE interfaces defined, so referencing that shortens the code a bit. Attached is a sample, also a separate Browser2.vb text file for those just want a peek at the core code (BrowserOptions is a DLCTL enum).

For more complete extended browser controls, try for example:
The most complete C# Webbrowser wrapper control - CodeProject
csexwb2 - The most complete .NET Webbrowser control wrapper - Google Project Hosting
 

Attachments

  • vbnet40-DISPID_AMBIENT_DLCONTROL.zip
    20.7 KB · Views: 76
  • Browser2.vb.txt
    2.7 KB · Views: 60
JohnH, I knos you made an effort with helping me :)
But I really don't understand what you're getting at....

Could you, or someone else further elaborate. Or explain simply how to accomplish stopping the browser downloading anything other than text (without fiddleing with registry)
 
The project I uploaded does what you ask for.
 
Back
Top