Visual Basic 5/6 Class Module
Updated October 22, 2000
|
|
|
|
Download The Visual Basic Class Module Here (80k)
- Version 4.0 preview updated January 29, 2000
- Last updated to version 3.0h, December 24, 1999
- Version 4.0 preview available January 1, 2000
- Updated to be able to recognize hhctrl.ocx version 4.74.8702
(HTML Help 1.3 final) in the HHFriendlyName and HHVersion
methods, and Internet Explorer 5.5 Platform Preview in the
IEFriendlyName and IEVersion methods.
- For simpler subclassing techniques, and a downloadable
project illustrating using TCards with Visual Basic, click
here.
One of the problems with Visual Basic 5 and 6 is that there's very little support for HTML Help. While CHM's are supported in the App.HelpFile property, the common dialog's ShowHelp method was never updated for use with HTML Help. Q233398, "PRB: Common Dialog ShowHelp Method does not Work with CHM Files" addresses this issue. If you're seeing an error message stating "The [filename] file is not a Windows Help file, or the file is corrupted", the class module on this page is what you're looking for.
The HTML Help class module wraps the majority of the HTML Help
API into a single object, and provides other functionality as well,
i.e., registry operations, etc. It works with Visual Basic 5 and 6,
and all versions of HTML Help.
We're hoping the release of this class module can also be used as
an avenue to provide more developers input into the methods of
calling HTML Help from Visual Basic and VBA applications. A separate
version may be created for VBA at a later date if enough requests
warrant.
One interesting result of this work is that it fixes an
irritating problem with using HTML Help-based What's This topics in
Visual Basic 6 with versions of hhctrl.ocx earlier than 4.74.8637.
This is where the popup appears behind the application, and the only
indication that the popup has been created is a blank button on the
taskbar. Clicking the button on the taskbar brings the popup to the
front where it can be read. Testing has proven that using the
technique described in the class module's documentation for the
HHSubClass procedure fixes this problem. The popups subsequently
appear in front of the application 100% of the time.
The class module, an associated code module, and a companion Help
file, are included.
The HTML Help class module has the following methods and
properties, and the associated code module has the listed
subroutines:
Methods:
- HHCheckRegistry - Checks the registration of the
specified CHM file.
- HHClose - Closes all open HTML Help windows.
- HHDeleteJumpURLSysMenu - Deletes the 'Jump To URL'
menu selection from an open HTML Help window.
- HHDisplayALink - Display a topic with an ALink as
specified in the HHALink property.
- HHDisplayContents - Forces the HTML Help file to
display the Contents tab.
- HHDisplayIndex - Forces the HTML Help file to display
the Index tab.
- HHDisplayKeyword - Display a topic with a keyword as
given in the HHKeyword property.
- HHDisplayPopup - Displays a text popup at the current
coordinates of the mouse pointer.
- HHDisplaySearch - Forces the HTML Help file to display
the Search tab.
- HHDisplayTopicID - Displays a given topic according to
the HHTopicID property.
- HHDisplayTopicURL - Displays a given topic according
to the HHTopicURL property.
- HHInvokeWhatsThisHelp - Converts the mouse pointer to
the What's This mouse pointer. When the left button is
then clicked on a control, What's This is invoked for
that control. Great for creating a What's This? menu
item.
- HHRegister - Registers the specified CHM file.
- HHSetHelpFile - Used with the CHMFile property,
provides a method for specifying multiple HTML Help
files within the class.
- HHUnregister - Deletes the specified CHM file from the
registry.
- HHVerifyMinConfig - Returns True if the HTML Help and
Internet Explorer versions on the system are higher than
what's desired, False if they're not.
- HHInvokeWhatsThisHelp - Converts the mouse pointer to
the What's This mouse pointer. When the left button is
then clicked on a control, What's This is invoked for
that control. Great for creating a What's This? menu
item.
Properties:
- CHMFile - Path and file name of the HTML Help file to
display.
- HHALink - Specifies an ALink keyword to search for
using HHDisplayALink.
- HHDefaultURL - Specifies the URL to use if a keyword
cannot be found.
- HHInstalled - Returns True if HTML Help is installed
on a given system.
- HHKeyword - Specifies a keyword to search for using
HHDisplayKeyword
- HHMsgText - Specifies the text to display in a message
box if a keyword cannot be found.
- HHMsgTitle - Specifies the title to display on a
message box if a keyword cannot be found.
- HHPopupBackColor - Sets the back color of a popup
generated with HHDisplayPopup using the standard VB
color constants.
- HHPopupCustomBackColor - Sets the back color of a
popup generated with HHDisplayPopup using custom colors
in the form &HBBGGRR.
- HHPopupCustomColors - True of the
HHPopupCustomTextColor and HHPopupCustomBackColor are
going to be used, False if not.
- HHPopupCustomTextColor - Sets the text color for a
popup generated with HHDisplayPopup using custom colors
in the form &HBBGGRR.
- HHPopupFile - Specifies the text file containing the
popup text as listed in the [TEXT POPUPS] section of a
CHM.
- HHPopupID - Specifies the resource containing the to
retrieve popup text from as listed in a Visual Basic
project or the context integer of a popup topic as
specified in a valid popup file in a CHM.
- HHPopupText - Specifies the text to display in a
simple text popup.
- HHPopupTextBold - Set to True to make the popup text
bold, False otherwise.
- HHPopupTextColor - Sets the text color for a popup
generated with HHDisplayPopup using the standard VB
color constants.
- HHPopupTextFont - Name of the font to be used in a
text popup.
- HHPopupTextItalic - Set to True to make the popup text
italicized, False otherwise.
- HHPopupTextSize - Point size of the font used in a
text popup.
- HHPopupTextUnderline - Set to True to make the popup
text underlined, False otherwise.
- HHPopupType - The type of popup to be generated by
HHDisplayPopup.
- HHRegFileExists - Used in conjunction with
HHCheckRegistry, returns True if the file exists at the
registered path, False if it doesn't.
- HHRegFileName - Used in conjunction with
HHCheckRegistry, returns the confirmed CHM file name.
- HHRegFilePath - Used in conjunction with
HHCheckRegistry, returns path of the confirmed CHM file
name.
- HHSetHelpFile - Used with the CHMFile property,
provides a method for specifying multiple HTML Help
files within the class.
- HHShowOnTop - If set to True, the HTML Help window
will be set as a sibling of the calling window.
- HHTopicID - Specifies the context integer for the
HHDisplayTopicID method
- HHTopicURL - Specifies the topic path and file name
for the HHDisplayTopicURL method
- HHVersion - Returns the current version of HTML Help
on the system as s String expression.
- HHWindow - Specifies the window for use with the
HHDisplayTopicID and HHDisplayTopicURL methods.
- HHWndHandle - Returns the handle of the last HTML Help
window opened by the class module. Read only.
- IEVersion - Returns the current version of Internet
Explorer on the system as s String expression.
- HHFriendlyName - Returns the friendly name of the HTML
Help version as a String expression (i.e,
"1.21a").
- IEFriendlyName - Returns the friendly name of the
Internet Explorer version as a String expression (i.e,
"5.0").
Subroutines
- HHSubclass - Allows for the subclassing of the calling
form in order to enable the interception of Windows
messaging for the form. This will allow Visual Basic 5
developers to use HTML Help-based What's This Help, and
provides a method for all Visual Basic developers to use
customized What's This popups. With a bit of work, it
also allows for the separation of What's This Help and
the operation of the F1 key. This information is also
included in the Help topic for the HHSubclass
subroutine.
- HHUnSubclass - Releases a previously subclassed form.
|
|