ShowHelp

Far Manager

ShowHelp

The ShowHelp function shows the specified topic from a given hlf-file.
BOOL WINAPI ShowHelp(
  const char *ModuleName,
  const char *HelpTopic,
  int   Flags
);

Parameters

ModuleName
Name of the plugin module. It is passed to the plugin in the SetStartupInfo function.
HelpTopic
Help topic. If this parameter is NULL, then the topic "Contents" will be used.
Flags
Can be one of the following values (FarHelpFlags enum):
ConstantDescription
FHELP_SELFHELP Assume ModuleName is Info.ModuleName and show the topic from the help file of the calling plugin. If HelpTopic begins with a coulomb ':', the topic from the main FAR help file will be shown (in that case ModuleName is ignored).
FHELP_FARHELP ModuleName is ignored and the topic from the main FAR help file will be shown. In this case you do not need to start the HelpTopic with a coulomb ':'.
FHELP_CUSTOMFILE Assume ModuleName specifies full path to a hlf-file (c:\path\filename).
FHELP_CUSTOMPATH Assume ModuleName specifies full path to a folder (c:\path) from which a help file will be selected according to current language settings.
FHELP_USECONTENTS If the specified HelpTopic is not found, will try to show the "Contents" topic. This flag can be combined with other flags.
FHELP_NOSHOWERROR Disable file or topic not found error messages for this function call. This flag can be combined with other flags.

Return value

TRUE - parameters were successfully transferred to the Help Manager.
FALSE - one of the following errors occurred:
  • Flags contains an illegal value.
  • ModuleName = NULL and FHELP_FARHELP flag is not set.
  • Specified help file or topic were not found by the Help Manager.
  • Help file or topic were not found while browsing the help file.

Example

For convience when frequently used the following function can be used in your plugin:
void ShowHelp(const char *HelpTopic)
{
  Info.ShowHelp(Info.ModuleName,HelpTopic,0);
}
Info is defined as a global variable...
struct PluginStartupInfo Info;
...ans is initialized in the SetStartupInfo function:
void WINAPI _export SetStartupInfo(const struct PluginStartupInfo *Info)
{
. . .
  ::Info=*Info;
. . .
}
See also: