WBCustomizer.dll Implements IDocHostUIHandler for VB

ID: Q183235


The information in this article applies to:
  • Microsoft Internet Explorer (Programming) versions 4.0, 4.01, 5
  • Microsoft Visual Basic Professional and Enterprise Editions for Windows, version 5.0


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:

  • Turn context menus on or off.


  • Turn all accelerator keys on or off.


  • Turn specific accelerator keys on or off.


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 Download Center. Click the file name below to download the file:

WBCustom.exe
For more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address
http://www.microsoft.com/downloads/search.asp
and then click How to use the Microsoft Download Center.

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:

    • nKeyCode - The key code constant that specifies an accelerator key (vbKeyTab, vbKeyN, vbKeyO, and so on).


    • nVirtExtKey - The virtual key code of an extended key, such as vbKeyControl, vbKeyAlt, or vbKeyShift. This parameter is optional and has a default value of 0.


    • bState - The state of the accelerator key. True turns on the accelerator key and False turns it off.





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 kbWebBrowser kbIE500 AXSDKWebBrowser kbIEFAQ
Version : WINDOWS:4.0,4.01,5,5.0
Platform : WINDOWS
Issue type : kbinfo


Last Reviewed: January 27, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.