WBHost is an ActiveX control serving as a wrapper for the Microsoft WebBrowser control. WBHost inherits all events, properties and methods of the WebBrowser control and adds its own. It implements the methods of the IDocHostUIHandler, IDocHostUIHandler2 and IDocHostShowUI interfaces. Each method of these COM interfaces generates a certain event that an application can process. It allows you to do the following:
- Intercept and modify messages displayed by WebBrowser.
- Cancel displaying script error messages.
- Forbid viewing the source code of HTML pages.
- Add or remove items in the context menu or disable the context menu altogether.
- Call internal methods of your application from HTML scripts.
- Change the behavior of the drag-and-drop feature.
- Disable text selection on HTML pages.
- Remove the 3D frame of the WebBrowser window.
- Remove scrollbars or change the way they look (flat or 3D).
- Apply a cascade style sheet (CSS) from an application to the HTML page being displayed.
- Specify individual settings for the instances of the WBHost objects independent of the global IE settings.
- Intercept the specified key combinations and process them they way you need.
- Cancel downloading from the server and displaying images, video or playing background music.
- Cancel downloading and executing ActiveX objects.
- Disable scripts and Java applets.
- Switch WebBrowser to the offline mode.
- Cancel displaying messages while downloading HTML pages.