WinHelp

Version 3.0

Syntax

BOOL WinHelp(hWnd,lpHelpFile,wCommand,dwData)

This function invokes the Windows Help application and passes optional data indicating the nature of the help requested by the application. The application specifies the name and, where required, the directory path of the help file which the Help application is to display.

Parameter Type/Description  

hWnd HWND Identifies the window requesting help.  
lpHelpFile LPSTR Points to a null-terminated string containing the directory path, if needed, and the name of the help file which the Help application is to display.  
wCommand WORD Specifies the type of help requested. It may be any one of the following values:  
  Value Meaning
  HELP_CONTEXT Displays help for a particular context identified by a 32-bit unsigned integer value in dwData.
  Value Meaning
  HELP_HELPONHELP Displays help for using the help application itself. If the wCommand parameter is set to HELP_HELP-ONHELP, WinHelp ignores the lpHelpFile and dwData parameters.
  HELP_INDEX Displays the index of the specified help file. An application should use this value only for help files with a single index. It should not use this value with HELP_SETINDEX.
  HELP_KEY Displays help for a particular key word identified by a string pointed to by dwData.
  HELP_MULTIKEY Displays help for a key word in an alternate keyword table.
  HELP_QUIT Notifies the help application that the specified help file is no longer in use.
  HELP_SETINDEX Sets the context specified by the dwData parameter as the current index for the help file specified by the lpHelpFile parameter. This index remains current until the user accesses a different help file. To help ensure that the correct index remains set, the application should call WinHelp with wCommand set to HELP_SETINDEX (with dwData specifying the corresponding context identifier) following each call to WinHelp with wCommand set to HELP_CONTEXT. An application should use this value only for help files with more than one index. It should not use this value with HELP_INDEX.
dwData DWORD Specifies the context or key word of the help requested. If wCommand is HELP_CONTEXT, dwData is a 32-bit unsigned integer containing a context-identifier number. If wCommand is HELP_KEY, dwData is a long pointer to a null-terminated string that contains a key word identifying the help topic. If wCommand is HELP_MULTIKEY, dwData is a long pointer to a MULTIKEYHELP data structure. Otherwise, dwData is ignored and should be set to NULL.  

Return Value

The return value specifies the outcome of the function. It is TRUE if the function was successful. Otherwise it is FALSE.

Comments

The application must call WinHelp with wCommand set to HELP_QUIT before closing the window that requested the help. The Help application will not actually terminate until all applications that have requested help have called WinHelp with wCommand set to HELP_QUIT.