WBCustomizer.dll Implements IDocHostUIHandler for VB
ID: Q183235
|
The information in this article applies to:
-
Microsoft Internet Explorer (Programming) versions 5.0, 4.0, 4.01
-
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 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
- Register WBCustomizer.dll on your system by using regsvr32 as follows:
regsvr32 WBCustomizer.dll
- Create a new Visual Basic application. (You can use a pre-existing
Visual Basic application that is hosting the WebBrowser control.)
- Include the component "Microsoft Internet Controls" in your application.
- Draw the WebBrowser control on your form.
- Set a reference to "Microsoft WebBrowser Customizer Sample Object."
- Dim a variable of type WBCustomizer as follows:
Dim CustomWB As WBCustomizer
- In your Form_Load event, create a new instance of the WBCustomizer
object as follows:
Set CustomWB = New WBCustomizer
- 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.
- Turn on/off context menus by setting the EnableContextMenus property. A
value of True turns context menus on. False turns them off.
- 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.
- 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 kbIE500 AXSDKWebBrowser
Version : WINDOWS:4.0,4.01,5.0
Platform : WINDOWS
Issue type :
Last Reviewed: May 3, 1999