Util.cpp
/*--- function RunHelp ------------------------------------------------
 *
 *  Bring up the help file for the current application.
 *  Assume the file is located in the same directory as the
 *  .EXE, and that its name ends in .HLP.
 *
 *  Entry:  hwndMain is the window handle for the app's main window.
 *          uCommand is the HELP command: HELP_CONTENTS, HELP_CONTEXT, etc.
 *          contextID is the help context ID
 *
 *  Exit:   Returns non-zero if succeeds, else FALSE.
 */
function RunHelp
Bring up the help file for the current application.
Assume the file is located in the same directory as the
.EXE, and that its name ends in .HLP.

hwndMain is the window handle for the app's main window.
uCommand is the HELP command: HELP_CONTENTS, HELP_CONTEXT, etc.
contextID is the help context ID

Returns non-zero if succeeds, else FALSE.
function RunHelp Bring up the help file for the current application . Assume the file is located in the same directory as the . EXE and that its name ends in . HLP . hwndMain is the window handle for the app ' s main window . uCommand is the HELP command : HELP_CONTENTS HELP_CONTEXT etc . contextID is the help context ID Returns non - zero if succeeds else FALSE .
BOOL RunHelp(HWND hwndMain,UINT uCommand, DWORD contextID)
{
   char szFileName[_MAX_PATH];
   int retval = FALSE;
   GetModuleFileName(NULL, szFileName, _MAX_PATH);
   int len = strlen(szFileName);
   if(len>4) {
      strcpy(szFileName+len-3,"HLP");
      retval = ::WinHelp(hwndMain,szFileName,uCommand,contextID);
   }
   return retval;
}
BOOL RunHelp ( HWND hwndMain , UINT uCommand , DWORD contextID ) { char szFileName [ _MAX_PATH ] ; int retval = FALSE ; GetModuleFileName ( NULL , szFileName , _MAX_PATH ) ; int len = strlen ( szFileName ) ; if ( len > 4 ) { strcpy ( szFileName + len - 3 , " " ) ; retval = :: WinHelp ( hwndMain , szFileName , uCommand , contextID ) ; } return retval ; }
function RunHelp
  Bring up the help file for the current application.
function RunHelp Bring up the help file for the current application .
// szFileName now has full path to the executable.  Change it to // the full path to the help file.