WBCustomizer.dll Implements IDocHostUIHandler for VB

ID: Q183235


The information in this article applies to:


SUMMARY

WBCustom.exe contains the WBCustomizer.dll, a sample COM object that demonstrates how to implement the IDocHostUIHandler interface for use in Visual Basic (VB) applications. If you are developing applications using the Internet Explorer 4.0x (IE4) WebBrowser control, the IDocHostUIHandler interface allows you to perform certain user interface functions, such as turning off context menus and accelerator keys.

If you are a Visual Basic developer and you are using the Internet Explorer 4.0 WebBrowser control, WBCustomizer allows you to perform the following:

The WBCustom.exe file includes the compiled WBCustomizer ATL object, as well as the ATL source code, so that you can customize this control to fit your own needs. WBCustom.exe also includes a sample Visual Basic application that demonstrates how to use the WBCustomizer control.

Please read the MORE INFORMATION section for instructions on how to use WBCustomizer in your Visual Basic application.

NOTE: This sample is not supported by Microsoft. If you require additional functionality, you can change the source code.


MORE INFORMATION

The following file is available for download from the Microsoft Software Library:

~ WBCustom.exe Release Date: Mar-26-1998

For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:

Q119591 How to Obtain Microsoft Support Files from Online Services

Using the WBCustomizer Control

  1. Register WBCustomizer.dll on your system by using regsvr32 as follows:
    regsvr32 WBCustomizer.dll


  2. Create a new Visual Basic application. (You can use a pre-existing Visual Basic application that is hosting the WebBrowser control.)


  3. Include the component "Microsoft Internet Controls" in your application.


  4. Draw the WebBrowser control on your form.


  5. Set a reference to "Microsoft WebBrowser Customizer Sample Object."


  6. Dim a variable of type WBCustomizer as follows:
    Dim CustomWB As WBCustomizer


  7. In your Form_Load event, create a new instance of the WBCustomizer object as follows:
    Set CustomWB = New WBCustomizer


  8. WBCustomizer needs a reference to the WebBrowser control that is on your form so that WBCustomizer can perform user interface functions for the WebBrowser control. Set this reference using the WBCustomizer.WebBrowser property as follows:
    Set CustomWB.WebBrowser = WebBrowser1
    Please note that WBCustomizer includes get and put functions for the WebBrowser method. However, the get function is not currently implemented. You may implement this yourself if you need this functionality.


  9. Turn on/off context menus by setting the EnableContextMenus property. A value of True turns context menus on. False turns them off.


  10. Turn on/off all accelerator keys by setting the EnableAllAccelerators property. A value of True turns context menus are on. False turns them off. Only those accelerators that require CTRL, SHIFT, or ALT key combinations will be turned off. Those that do not require one of these keys, such as TAB, F1, and so forth, can be turned off directly as described in step 11.

    Note that the Ctrl+O accelerator that worked in Internet Explorer 4 is no longer available in version 5 within the WebBrowser control.


  11. Turn on/off specific accelerator keys by using the EnableAccelerator method. The following parameters apply to this method:




REFERENCES

Please refer to "Advanced Hosting Interfaces" in the Internet Client SDK Help for more information regarding IDocHostUIHandler:

http://www.microsoft.com/msdn/sdk/inetsdk/help/itt/IEProg/IEProg.htm
(c) Microsoft Corporation 1998, All Rights Reserved. Contributions by Scott Roberts, Microsoft Corporation

Additional query words:


Keywords          : kbfile kbsample kbIE400 kbIE401 kbVBp500 kbIE500 AXSDKWebBrowser 
Version           : WINDOWS:4.0,4.01,5.0
Platform          : WINDOWS 
Issue type        : 

Last Reviewed: May 3, 1999