All applications are tapplication derived classes. Tapplication has three ways to invoke the online Help system.
The HelpContext method can invoke WinHelp (see the previous section for WinHelp content). It passes the filename in the HelpFile and a text code to WinHelp. HelpFile is a tapplication string-type property that is specifically used to store help files. If the HelpFile property is a null character, the HelpContext returns a false value, and all other cases return the truth.
The following example uses a button on the form, and when the user clicks the button, the screen appears with the theme No. 714 in the Data.hlp file.
Procedure Tform2.bin1click (Snder:tobject)
Begin
Application.helpfile: = Datahlp;
Application.helpcontext (714);
End
The Helpjump method can call WinHelp. It passes the file name in the HelpFile property and the content string for the Help file (see section 11.1). The content string is the only string in the Help file that identifies the Help topic. If the HelpFile property is a null character, the Helpfjump returns a false value, and all other cases return the truth.
The following example uses a button on the form. When the user clicks the button, the Help system DELPH2. The default attribute in the HLP file. Because the content string of the default property is Vcldefaultproperty.
Procedure tform1.tbn| Click (Sender:tobject)
Begin
Application.helpfile: = ' DELPHI. HLP ';
Application.helpjump (' Vcldefaultproperty ');
End
The Helpcommand method can quickly access various commands in the WinHelp function. Perform different actions according to these commands WinHelp. Table 11.2 is information about the WinHelp function.
BOOL WinHelp (Hwd,lpszhelpfile,fucommand,dwdata)
Parameters and implications of table 11.2 WinHelp
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Parameter type description
───────────────────────────────
HWND HWND Request for Help window
Lpszhelpfile LPSTK The file name of the Help file to be displayed
Fucommand unit request type of Help
Description table or keyword required for dwdata DWORD Help
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Helpcommand delivery to WinHelp Fucommand and Dwdata,fucommand is one of the column values in table 11.3 that the help type can be.
The value and meaning of table 11.3 Fucommand
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Value meaning
───────────────────────────────
Help_lontext Display dwdata Specifies the help information for the long description
Help_contents Display Help content topics
Help_set_lontents if Dwdata is OROL04 then in a pop-up
Show Help topics in Windows
Help_help ponhelp Show Help application's own assistance, letter
Number ignores Lpszhelpfile and dwdata parameters
Help_index Displays the index of the Help file
Help_key display Help for the keyword specified by dwdata
Help_multikey display Help for a keyword, the keyword
In a variable-key table
Help_quit to help application report file no longer used
Help_setndex the dwdata specified descriptor as the current index of the Help file
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The meaning of the dwdata parameter depends on the Fucommand setting, and if Fucommand is help_context,dwdata as a 32-bit unsigned integer, it contains a description table identification number: If Fucommand is Help_key,dwdata For a specified long pointer, the string is the keyword for the help. If Fucommand is helpmulltikey,dwdata, it points to a long pointer to a MULTIKEYHELP data structure.
The following example uses the buttons in the form. The Help content topic for the specified file is displayed when the user clicks the button Help system.
Procedure Tform1.bin1click (Sender:tobject)
Begin
Application.helpfile: = ' Myhlep.hlp '
Application.helpcommand (help_contents,0);
End