Delphi Learn About The DelphiVCL.Application.HelpContext Method

FireWind

Свой
Регистрация
2 Дек 2005
Сообщения
1,957
Реакции
1,199
Credits
4,009
Learn About The DelphiVCL.Application.HelpContext Method
By Muhammad Azizul Hakim October 25, 2021

Use the HelpContext method or DelphiVCL.Application.HelpContext to display the Help topic specified by the numeric context identifier.

Use HelpContext to show the Help topic specified by the numeric context identifier Context and which is from the file specified in the CurrentHelpFile property. HelpContext generates an OnHelp event (either on the active form or on the application object itself). If there is no OnHelp event handler, or if the event handler indicates that HTMLHelp should be called, then HelpContext invokes the HTMLHelp Windows help engine, passing it the context ID specified in the Context parameter.

For example, if the Context value is 714, the HelpContext method displays the help topic with the 714 context ID in the Help file specified by CurrentHelpFile. In the case of a .chm help file, you must map symbolic Context IDs of Help topics to numeric Context values in the [MAP] section of your project (.hhp) file.

HelpContext returns False if CurrentHelpFile is an empty string, meaning the application has no Help file assigned. In all other cases, HelpContext returns True.

In order for the Help to work properly, insert in the uses clause of your application the Vcl.HtmlHelpViewer or another unit that provides an interface to the external Help viewer to use. The Vcl.HtmlHelpViewer unit provides a Delphi interface to the HTMLHelp Windows native Help handling function. For C++, you need to include the HTMLHelpViewer.hpp header files.

For information about the native Help handling functions (HTMLHelp or other) and about the data passed to them, see the appropriate HTMLHelp topics in the MSDN Library.

How do I browse the properties of the DelphiVCL.Application.HelpContext method?

Let’s browse all the properties of the DelphiVCL.Application.HelpContext using dir() command:
Python:
import DelphiVCL
 
dir(DelphiVCL.Application.HelpContext)
See the responses in our Windows command prompt:
1635145580100.png
You can also read short information about the DelphiVCL.Application.HelpContext using the print() command:
Python:
print(DelphiVCL.Application.HelpContext)
print(DelphiVCL.Application.HelpContext.__doc__)
See the responses in our Windows command prompt:
1635145614627.png