ShowHelp Method, HelpFile, HelpContext, HelpKey, HelpCommand Property

Purpose

The CommDlg method ShowHelp invokes WinHelp and displays the .hlp Help file you specify; for .chm Help files, see Accessing HTMLHelp files.

Syntax

CommDlg.ShowHelp

CommDlg_HelpFile [ = string ]
CommDlg_HelpContext [ = integer ]
CommDlg_HelpKey [ = string ]
CommDlg_HelpCommand [ = integer ]

Description

The ShowHelp method calls Winhlp32.exe for the help file specified in the HelpFile property and in the mode specified HelpCommand.

The HelpFile property specifies the path and filename of the Help file to display with ShowHelp.

HelpContext returns or sets the context ID of the requested Help topic.

HelpKey returns or sets the keyword that identifies the requested Help topic.

The HelpCommand property returns or sets the type of online Help requested. This value should be one of the following constants.

cdhCommand (258) Executes a Help macro.
cdhContents (3) Displays the Help contents topic as defined by the Contents option in the [OPTION] section of the .hpj file. See Remarks below for information on Help files created with Microsoft Help Workshop 4.0X.
cdhContext (1) Displays Help for a particular context. When using this setting, you must also specify a context using the HelpContext property.
CdhContextPopup (8) Displays in a pop-up window a particular Help topic identified by a context number defined in the [MAP] section of the .hpj file.
cdhFinder (11) Displays the Help Topics dialog box.
cdhForceFile (9) Ensures WinHelp displays the correct Help file. If the correct Help file is currently displayed, no action occurs. If the incorrect Help file is displayed, WinHelp opens the correct file.
cdhHelpOnHelp (4) Displays Help for using the Help application itself.
cdhIndex (3) Displays the index of the specified Help file. An application should use this value only for a Help file with a single index.
cdhKey (257) Displays Help for a particular keyword. When using this setting, you must also specify a keyword using the HelpKey property.
cdhMultiKey (513) Displays the topic specified by a keyword in an alternative keyword table. HelpContext must contain the ASCII code of a single character that identifies the keyword table to search and HelpKey should specify the text string that specifies the keyword to locate in the keyword table.
cdhPartialKey (261) Displays the topic found in the keyword list that matches the keyword passed in the HelpKey property if there is one exact match.
cdhQuit (2) Notifies the Help application that the specified Help file is no longer in use.
cdhSetContents (5) Determines which contents topic is displayed when a user presses the F1 key.
cdhPopupPos (13) Sets the context specified by the HelpContext property as the current index for the Help file specified by the HelpFile property. This index remains current until the user accesses a different Help file. Use this value only for Help files with more than one index.

Example

Print

Local d$ = Left(ProgName$, RInStr(ProgName$, "\")) & "GfaWin32.hlp"

Ocx CommDlg cd

cd.HelpFile = d$

cd.HelpKey = "Form"

cd.HelpCommand = cdhKey

cd.ShowHelp

CloseW 1

See Also

CommDlg

{Created by Sjouke Hamstra; Last updated: 23/10/2014 by James Gaite}