home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / sp15demo.zip / libsrc.zip / LIBSRC / PMHELP.PAS < prev    next >
Pascal/Delphi Source File  |  1996-02-07  |  24KB  |  515 lines

  1. UNIT PmHelp;
  2.  
  3. {**************************************************************************
  4.  * Module Name: PMHELP.PAS                                                *
  5.  *                                                                        *
  6.  * OS/2 Presentation Manager Information Presentation Facility,           *
  7.  * Help Manager declarations.                                             *
  8.  *                                                                        *
  9.  **************************************************************************}
  10.  
  11. INTERFACE
  12.  
  13. USES Os2Def,PmBitmap,PmWin;
  14.  
  15. {**********************************************************************
  16.  HelpSubTable entry structure
  17.  **********************************************************************}
  18. TYPE
  19.     HELPSUBTABLE=USHORT;
  20.     PHELPSUBTABLE=^HELPSUBTABLE;
  21.  
  22.     PHELPTABLE=^HELPTABLE;
  23.     HELPTABLE=RECORD {pack 2}
  24.                    idAppWindow:USHORT;
  25.                    phstHelpSubTable:PHELPSUBTABLE;
  26.                    idExtPanel:USHORT;
  27.               END;
  28.  
  29. {**********************************************************************}
  30. { IPF Initialization Structure used on the                             }
  31. { WinCreateHelpInstance() call.                                        }
  32. {**********************************************************************}
  33. TYPE
  34.    PHELPINIT=^HELPINIT;
  35.    HELPINIT=RECORD
  36.                  cb:ULONG;
  37.                  ulReturnCode:ULONG;
  38.                  pszTutorialName:PCHAR;
  39.                  phtHelpTable:PHELPTABLE;
  40.                  hmodHelpTableModule:HMODULE;
  41.                  hmodAccelActionBarModule:HMODULE;
  42.                  idAccelTable:ULONG;
  43.                  idActionBar:ULONG;
  44.                  pszHelpWindowTitle:PChar;
  45.                  fShowPanelId:ULONG;
  46.                  pszHelpLibraryName:PChar;
  47.            END;
  48.  
  49.  
  50. {**********************************************************************}
  51. { Search parent chain indicator for HM_SET_ACTIVE_WINDOW message.      }
  52. {**********************************************************************}
  53. CONST
  54.      HWND_PARENT               =0;
  55.  
  56. {**********************************************************************}
  57. { Constants used to define whether user wants to display panel using   }
  58. { panel number or panel name.                                          }
  59. {**********************************************************************}
  60.      HM_RESOURCEID             =0;
  61.      HM_PANELNAME              =1;
  62.  
  63.      HMPANELTYPE_NUMBER        =0;
  64.      HMPANELTYPE_NAME          =1;
  65.  
  66. {**********************************************************************}
  67. { Constants used to define how the panel IDs are displayed on          }
  68. { help panels.                                                         }
  69. {**********************************************************************}
  70.      CMIC_HIDE_PANEL_ID        =$0000;
  71.      CMIC_SHOW_PANEL_ID        =$0001;
  72.      CMIC_TOGGLE_PANEL_ID      =$0002;
  73.  
  74.  
  75. {**********************************************************************}
  76. { IPF message base.                                                    }
  77. {**********************************************************************}
  78.      HM_MSG_BASE               =$0220;
  79.  
  80.    {**********************************************************************}
  81.    { Messages applications can send to the IPF.                           }
  82.    {**********************************************************************}
  83.      HM_DISMISS_WINDOW              =HM_MSG_BASE+$0001;
  84.      HM_DISPLAY_HELP                =HM_MSG_BASE+$0002;
  85.      HM_EXT_HELP                    =HM_MSG_BASE+$0003;
  86.      HM_GENERAL_HELP                =HM_EXT_HELP;
  87.      HM_SET_ACTIVE_WINDOW           =HM_MSG_BASE+$0004;
  88.      HM_LOAD_HELP_TABLE             =HM_MSG_BASE+$0005;
  89.      HM_CREATE_HELP_TABLE           =HM_MSG_BASE+$0006;
  90.      HM_SET_HELP_WINDOW_TITLE       =HM_MSG_BASE+$0007;
  91.      HM_SET_SHOW_PANEL_ID           =HM_MSG_BASE+$0008;
  92.      HM_REPLACE_HELP_FOR_HELP       =HM_MSG_BASE+$0009;
  93.      HM_REPLACE_USING_HELP          =HM_REPLACE_HELP_FOR_HELP;
  94.      HM_HELP_INDEX                  =HM_MSG_BASE+$000a;
  95.      HM_HELP_CONTENTS               =HM_MSG_BASE+$000b;
  96.      HM_KEYS_HELP                   =HM_MSG_BASE+$000c;
  97.      HM_SET_HELP_LIBRARY_NAME       =HM_MSG_BASE+$000d;
  98.  
  99.      HM_SET_OBJCOM_WINDOW           =HM_MSG_BASE+$0018;
  100.      HM_UPDATE_OBJCOM_WINDOW_CHAIN  =HM_MSG_BASE+$0019;
  101.      HM_QUERY_DDF_DATA              =HM_MSG_BASE+$001a;
  102.      HM_INVALIDATE_DDF_DATA         =HM_MSG_BASE+$001b;
  103.      HM_QUERY                       =HM_MSG_BASE+$001c;
  104.      HM_SET_COVERPAGE_SIZE          =HM_MSG_BASE+$001d;
  105.  
  106.    {**********************************************************************}
  107.    { Constants used to query the info from IPF in HM_QUERY message        }
  108.    {**********************************************************************}
  109.  
  110.    { Hi word in lParam 1 }
  111.      HMQW_COVERPAGE           =$0001;
  112.      HMQW_INDEX               =$0002;
  113.      HMQW_TOC                 =$0003;
  114.      HMQW_SEARCH              =$0004;
  115.      HMQW_VIEWPAGES           =$0005;
  116.      HMQW_LIBRARY             =$0006;
  117.      HMQW_VIEWPORT            =$0007;
  118.      HMQW_OBJCOM_WINDOW       =$0008;
  119.      HMQW_INSTANCE            =$0009;
  120.      HMQW_ACTIVEVIEWPORT      =$000a;
  121.      CONTROL_SELECTED         =$000b;
  122.  
  123.      HMQW_GROUP_VIEWPORT      =$00f1;
  124.      HMQW_RES_VIEWPORT        =$00f2;
  125.      USERDATA                 =$00f3;
  126.  
  127.    { Lo word in lParam1 of HMQW_VIEWPORT }
  128.      HMQVP_NUMBER             =$0001;
  129.      HMQVP_NAME               =$0002;
  130.      HMQVP_GROUP              =$0003;
  131.  
  132.    {**********************************************************************}
  133.    { Predefined Control IDs                                               }
  134.    {**********************************************************************}
  135.      CTRL_PREVIOUS_ID             =$0001;
  136.      CTRL_SEARCH_ID               =$0002;
  137.      CTRL_PRINT_ID                =$0003;
  138.      CTRL_INDEX_ID                =$0004;
  139.      CTRL_CONTENTS_ID             =$0005;
  140.      CTRL_BACK_ID                 =$0006;
  141.      CTRL_FORWARD_ID              =$0007;
  142.      CTRL_TUTORIAL_ID             =$00FF;
  143.  
  144.      CTRL_USER_ID_BASE            =257;
  145.  
  146.    {**********************************************************************}
  147.    { Messages the IPF sends to the applications active window             }
  148.    { as defined by the IPF.                                               }
  149.    {**********************************************************************}
  150.  
  151.      HM_ERROR                       =HM_MSG_BASE+$000e;
  152.      HM_HELPSUBITEM_NOT_FOUND       =HM_MSG_BASE+$000f;
  153.      HM_QUERY_KEYS_HELP             =HM_MSG_BASE+$0010;
  154.      HM_TUTORIAL                    =HM_MSG_BASE+$0011;
  155.      HM_EXT_HELP_UNDEFINED          =HM_MSG_BASE+$0012;
  156.      HM_GENERAL_HELP_UNDEFINED      =HM_EXT_HELP_UNDEFINED;
  157.      HM_ACTIONBAR_COMMAND           =HM_MSG_BASE+$0013;
  158.      HM_INFORM                      =HM_MSG_BASE+$0014;
  159.      HM_NOTIFY                      =HM_MSG_BASE+$0022;
  160.      HM_SET_USERDATA                =HM_MSG_BASE+$0023;
  161.      HM_CONTROL                     =HM_MSG_BASE+$0024;
  162.  
  163.    {**********************************************************************}
  164.    { notify information for HM_NOTIFY                                     }
  165.    {**********************************************************************}
  166.      OPEN_COVERPAGE        =$0001;
  167.      OPEN_PAGE             =$0002;
  168.      SWAP_PAGE             =$0003;
  169.      OPEN_TOC              =$0004;
  170.      OPEN_INDEX            =$0005;
  171.      OPEN_HISTORY          =$0006;
  172.      OPEN_SEARCH_HIT_LIST  =$0007;
  173.      OPEN_LIBRARY          =$0008;
  174.      HELP_REQUESTED        =$0009;
  175.  
  176.    {**********************************************************************}
  177.    { HMERR_NO_FRAME_WND_IN_CHAIN - There is no frame window in the        }
  178.    { window chain from which to find or set the associated help           }
  179.    { instance.                                                            }
  180.    {**********************************************************************}
  181.       HMERR_NO_FRAME_WND_IN_CHAIN                =$00001001;
  182.  
  183.    {*********************************************************************}
  184.    { HMERR_INVALID_ASSOC_APP_WND - The application window handle         }
  185.    { specified on the WinAssociateHelpInstance() call is not a valid     }
  186.    { window handle.                                                      }
  187.    {*********************************************************************}
  188.       HMERR_INVALID_ASSOC_APP_WND                =$00001002;
  189.  
  190.    {*********************************************************************}
  191.    { HMERR_INVALID_ASSOC_HELP_INST - The help instance handle specified  }
  192.    { on the WinAssociateHelpInstance() call is not a valid               }
  193.    { window handle.                                                      }
  194.    {*********************************************************************}
  195.       HMERR_INVALID_ASSOC_HELP_INST              =$00001003;
  196.  
  197.    {*********************************************************************}
  198.    { HMERR_INVALID_DESTROY_HELP_INST - The window handle specified       }
  199.    { as the help instance to destroy is not of the help instance class.  }
  200.    {*********************************************************************}
  201.       HMERR_INVALID_DESTROY_HELP_INST            =$00001004;
  202.  
  203.    {*********************************************************************}
  204.    { HMERR_NO_HELP_INST_IN_CHAIN - The parent or owner chain of the      }
  205.    { application window specified does not have a help instance          }
  206.    { associated with it.                                                 }
  207.    {*********************************************************************}
  208.       HMERR_NO_HELP_INST_IN_CHAIN                =$00001005;
  209.  
  210.    {*********************************************************************}
  211.    { HMERR_INVALID_HELP_INSTANCE_HDL - The handle specified to be a      }
  212.    { help instance does not have the class name of a IPF                 }
  213.    { help instance.                                                      }
  214.    {*********************************************************************}
  215.       HMERR_INVALID_HELP_INSTANCE_HDL            =$00001006;
  216.  
  217.    {*********************************************************************}
  218.    { HMERR_INVALID_QUERY_APP_WND - The application window specified on   }
  219.    { a WinQueryHelpInstance() call is not a valid window handle.         }
  220.    {*********************************************************************}
  221.       HMERR_INVALID_QUERY_APP_WND                =$00001007;
  222.  
  223.    {*********************************************************************}
  224.    { HMERR_HELP_INST_CALLED_INVALID -  The handle of the help instance   }
  225.    { specified on an API call to the IPF does not have the               }
  226.    { class name of an IPF help instance.                                 }
  227.    {*********************************************************************}
  228.       HMERR_HELP_INST_CALLED_INVALID             =$00001008;
  229.  
  230.       HMERR_HELPTABLE_UNDEFINE                   =$00001009;
  231.       HMERR_HELP_INSTANCE_UNDEFINE               =$0000100a;
  232.       HMERR_HELPITEM_NOT_FOUND                   =$0000100b;
  233.       HMERR_INVALID_HELPSUBITEM_SIZE             =$0000100c;
  234.       HMERR_HELPSUBITEM_NOT_FOUND                =$0000100d;
  235.  
  236.    {*********************************************************************}
  237.    { HMERR_INDEX_NOT_FOUND - No index in library file.                   }
  238.    {*********************************************************************}
  239.       HMERR_INDEX_NOT_FOUND                      =$00002001;
  240.  
  241.    {*********************************************************************}
  242.    { HMERR_CONTENT_NOT_FOUND - Library file does not have any contents.  }
  243.    {*********************************************************************}
  244.       HMERR_CONTENT_NOT_FOUND                    =$00002002;
  245.  
  246.    {*********************************************************************}
  247.    { HMERR_OPEN_LIB_FILE     - Cannot open library file                  }
  248.    {*********************************************************************}
  249.       HMERR_OPEN_LIB_FILE                        =$00002003;
  250.  
  251.    {*********************************************************************}
  252.    { HMERR_READ_LIB_FILE     - Cannot read library file                  }
  253.    {*********************************************************************}
  254.       HMERR_READ_LIB_FILE                        =$00002004;
  255.  
  256.    {*********************************************************************}
  257.    { HMERR_CLOSE_LIB_FILE    - Cannot close library file                 }
  258.    {*********************************************************************}
  259.       HMERR_CLOSE_LIB_FILE                       =$00002005;
  260.  
  261.    {*********************************************************************}
  262.    { HMERR_INVALID_LIB_FILE  - Improper library file provided            }
  263.    {*********************************************************************}
  264.       HMERR_INVALID_LIB_FILE                     =$00002006;
  265.  
  266.    {*********************************************************************}
  267.    { HMERR_NO_MEMORY - Unable to allocate the requested amount of memory.}
  268.    {*********************************************************************}
  269.       HMERR_NO_MEMORY                            =$00002007;
  270.  
  271.    {*********************************************************************}
  272.    { HMERR_ALLOCATE_SEGMENT - Unable                                     }
  273.    { to allocate a segment of memory for memory allocation requested     }
  274.    { from the IPF.                                                       }
  275.    {*********************************************************************}
  276.       HMERR_ALLOCATE_SEGMENT                     =$00002008;
  277.  
  278.    {*********************************************************************}
  279.    { HMERR_FREE_MEMORY - Unable to free allocated  memory                }
  280.    {*********************************************************************}
  281.       HMERR_FREE_MEMORY                          =$00002009;
  282.  
  283.    {*********************************************************************}
  284.    { HMERR_PANEL_NOT_FOUND  - Unable                                     }
  285.    { to find a help panel requested to help manager                      }
  286.    {*********************************************************************}
  287.       HMERR_PANEL_NOT_FOUND                      =$00002010;
  288.  
  289.    {*********************************************************************}
  290.    { HMERR_DATABASE_NOT_OPEN - Unable to read the unopened database      }
  291.    {*********************************************************************}
  292.       HMERR_DATABASE_NOT_OPEN                    =$00002011;
  293.  
  294.    {*********************************************************************}
  295.    { HMERR_DDL_ERROR - Unable to load resource dll                       }
  296.    {*********************************************************************}
  297.       HMERR_LOAD_DLL                              =$00002013;
  298.  
  299. {*********************************************************************}
  300. { AC Viewport stucture definitions                                    }
  301. {*********************************************************************}
  302. TYPE
  303.    PACVP=^ACVP;
  304.    ACVP=RECORD
  305.              cb:ULONG;
  306.              hAB:HAB;
  307.              hmq:HMQ;
  308.              ObjectID:ULONG;            { object identifier }
  309.              hWndParent:HWND;           { IPF viewport client handle }
  310.              hWndOwner:HWND;            { IPF viewport client handle }
  311.              hWndACVP:HWND;             { applications frame window hwnd }
  312.         END;
  313.  
  314. {*******************************************************************}
  315. { Define Handle to DDF                                              }
  316. {*******************************************************************}
  317. TYPE
  318.     HDDF=POINTER;
  319.  
  320. { DdfHyperText Flags }
  321. CONST
  322.         REFERENCE_BY_ID     =0;
  323.         REFERENCE_BY_RES    =1;
  324.  
  325. { DdfBeginList formatting flags }
  326.         HMBT_NONE           =1;
  327.         HMBT_ALL            =2;
  328.         HMBT_FIT            =3;
  329.  
  330.         HMLS_SINGLELINE     =1;
  331.         HMLS_DOUBLELINE     =2;
  332.  
  333. { DdfBitmap alignment flags }
  334.         ART_RUNIN           =$10;
  335.         ART_LEFT            =$01;
  336.         ART_RIGHT           =$02;
  337.         ART_CENTER          =$04;
  338.  
  339. { DdfSetColor Color Flag }
  340.         CLR_UNCHANGED       =-6;
  341.  
  342. {*******************************************************************}
  343. { error codes returned by DDF API functions                         }
  344. {*******************************************************************}
  345. CONST
  346.         HMERR_DDF_MEMORY                  =$3001;
  347.         HMERR_DDF_ALIGN_TYPE              =$3002;
  348.         HMERR_DDF_BACKCOLOR               =$3003;
  349.         HMERR_DDF_FORECOLOR               =$3004;
  350.         HMERR_DDF_FONTSTYLE               =$3005;
  351.         HMERR_DDF_REFTYPE                 =$3006;
  352.         HMERR_DDF_LIST_UNCLOSED           =$3007;
  353.         HMERR_DDF_LIST_UNINITIALIZED      =$3008;
  354.         HMERR_DDF_LIST_BREAKTYPE          =$3009;
  355.         HMERR_DDF_LIST_SPACING            =$300A;
  356.         HMERR_DDF_HINSTANCE               =$300B;
  357.         HMERR_DDF_EXCEED_MAX_LENGTH       =$300C;
  358.         HMERR_DDF_EXCEED_MAX_INC          =$300D;
  359.         HMERR_DDF_INVALID_DDF             =$300E;
  360.         HMERR_DDF_FORMAT_TYPE             =$300F;
  361.         HMERR_DDF_INVALID_PARM            =$3010;
  362.         HMERR_DDF_INVALID_FONT            =$3011;
  363.         HMERR_DDF_SEVERE                  =$3012;
  364.  
  365. IMPORTS
  366.  
  367. FUNCTION WinDestroyHelpInstance(hwndHelpInstance:HWND):BOOL;
  368.                APIENTRY;                    HELPMGR index 52;
  369. FUNCTION WinCreateHelpInstance(ahab:HAB;
  370.                                VAR phinitHMInitStructure:HELPINIT):HWND;
  371.                APIENTRY;                    HELPMGR index 51;
  372. FUNCTION WinAssociateHelpInstance(hwndHelpInstance,hwndApp:HWND):BOOL;
  373.                APIENTRY;                    HELPMGR index 54;
  374. FUNCTION WinQueryHelpInstance(hwndApp:HWND):HWND;
  375.                APIENTRY;                    HELPMGR index 53;
  376. FUNCTION WinLoadHelpTable(hwndHelpInstance:HWND;idHelpTable:ULONG;
  377.                           Module:HMODULE):BOOL;
  378.                APIENTRY;                    HELPMGR index 55;
  379. FUNCTION WinCreateHelpTable(hwndHelpInstance:HWND;
  380.                             VAR phtHelpTable:HELPTABLE):BOOL;
  381.                APIENTRY;                    HELPMGR index 56;
  382. FUNCTION DdfInitialize(hwndHelpInstance:HWND;cbBuffer,
  383.                        ulIncrement:ULONG):HDDF;
  384.                APIENTRY;                    HELPMGR index 74;
  385. FUNCTION DdfPara (ahddf:HDDF):BOOL;
  386.                APIENTRY;                    HELPMGR index 75;
  387. FUNCTION DdfSetFormat(ahddf:HDDF;fFormatType:ULONG):BOOL;
  388.                APIENTRY;                    HELPMGR index 76;
  389. FUNCTION DdfSetTextAlign (ahddf:HDDF;fAlign:ULONG):BOOL;
  390.                APIENTRY;                    HELPMGR index 77;
  391. FUNCTION DdfSetColor(ahddf:HDDF;fBackColor,fForColor:COLOR):BOOL;
  392.                APIENTRY;                    HELPMGR index 78;
  393. FUNCTION DdfInform(ahddf:HDDF;VAR pszText:PSZ;resInformNumber:ULONG):BOOL;
  394.                APIENTRY;                    HELPMGR index 79;
  395. FUNCTION DdfSetFontStyle(ahddf:HDDF;fFontStyle:ULONG):BOOL;
  396.                APIENTRY;                    HELPMGR index 80;
  397. FUNCTION DdfHyperText(ahddf:HDDF;VAR pszText,pszReference:PSZ;
  398.                        fReferenceType:ULONG):BOOL;
  399.                APIENTRY;                    HELPMGR index 81;
  400. FUNCTION DdfBeginList(ahddf:HDDF;ulWidthDT,fBreakType,
  401.                       fSpacing:ULONG):BOOL;
  402.                APIENTRY;                    HELPMGR index 82;
  403. FUNCTION DdfListItem(ahddf:HDDF;VAR pszTerm,pszDescription:PSZ):BOOL;
  404.                APIENTRY;                    HELPMGR index 83;
  405. FUNCTION DdfEndList(ahddf:HDDF):BOOL;
  406.                APIENTRY;                    HELPMGR index 84;
  407. FUNCTION DdfMetafile(ahddf:HDDF;ahmf:HMF;VAR prclRect:RECTL):BOOL;
  408.                APIENTRY;                    HELPMGR index 86;
  409. FUNCTION DdfText(ahddf:HDDF;VAR pszText:PSZ):BOOL;
  410.                APIENTRY;                    HELPMGR index 85;
  411. FUNCTION DdfSetFont(ahddf:HDDF;VAR pszFaceName:PSZ;ulWidth,
  412.                     ulHeight:ULONG):BOOL;
  413.                APIENTRY;                    HELPMGR index 87;
  414. FUNCTION DdfBitmap(ahddf:HDDF;hbm:HBITMAP;fAlign:ULONG):BOOL;
  415.                APIENTRY;                    HELPMGR index 88;
  416.  
  417. END; {IMPORTS}
  418.  
  419. {Help manager helpers}
  420. CONST HelpFilename:CSTRING='FILENAME.HLP';
  421.       HelpWindowTitle:CSTRING='Überschrift des Hypertext-Fensters';
  422.  
  423.       fHelpEnabled:BOOL=FALSE;
  424.       hwndHelpInstance:HWND=0;
  425.       HELP_TABLE:LONGINT=0;
  426.  
  427. FUNCTION InfoBox(st:STRING):LONGINT;
  428. PROCEDURE InitHelp (hwndClientFrame:HWND);
  429. PROCEDURE DestroyHelp;
  430. PROCEDURE SendHelpMessage (HelpMessage:LONG);
  431. PROCEDURE DisplayHelpPanel (PanelID:LONG);
  432.  
  433. IMPLEMENTATION
  434.  
  435. {Help manager helpers}
  436.  
  437. FUNCTION InfoBox(st:STRING):LONGINT;
  438. BEGIN
  439.      result:=WinMessageBox (HWND_DESKTOP, HWND_DESKTOP, st,'', 0, MB_OK | MB_ERROR);
  440. END;
  441.  
  442. /*wird vor die Hauptprogramm-Message-Schleife (while WinGetMsg...) gesetzt*/
  443. PROCEDURE InitHelp (hwndClientFrame:HWND);
  444. VAR
  445.    hini:HELPINIT;
  446.    /* If we return because of an error, Help will be disabled */
  447. BEGIN
  448.      fHelpEnabled := FALSE;
  449.      /* Initialize help init structure */
  450.      hini.cb := sizeof(HELPINIT);
  451.      hini.ulReturnCode := 0;
  452.      /* If tutorial added, add name here */
  453.      hini.pszTutorialName := NIL;
  454.      hini.phtHelpTable := PHELPTABLE(MAKELONG(HELP_TABLE, $FFFF));
  455.      hini.hmodHelpTableModule := 0;
  456.      hini.hmodAccelActionBarModule := 0;
  457.      hini.idAccelTable := 0;
  458.      hini.idActionBar := 0;
  459.      hini.pszHelpWindowTitle := @HelpWindowTitle;
  460.      hini.fShowPanelId := CMIC_HIDE_PANEL_ID;
  461.      hini.pszHelpLibraryName := @HelpFilename;
  462.      /* Creating help instance */
  463.      hwndHelpInstance := WinCreateHelpInstance(AppHandle,hini);
  464.      if ((hwndHelpInstance = 0 )OR(hini.ulReturnCode<>0)) THEN
  465.      BEGIN
  466.           InfoBox('Failed to load help manager.');
  467.           exit;
  468.      END;
  469.  
  470.      /* Associate help instance with main frame */
  471.      if not WinAssociateHelpInstance(hwndHelpInstance, hwndClientFrame) THEN
  472.      BEGIN
  473.           InfoBox('Failed to load help manager.');
  474.           exit;
  475.      END;
  476.  
  477.      /* Help manager is successfully initialized so set flag to TRUE */
  478.      fHelpEnabled := TRUE;
  479. END;
  480.  
  481. /*wird hinter die Hauptprogramm-Message-Schleife gesetzt*/
  482. PROCEDURE DestroyHelp;
  483. BEGIN
  484.      IF hwndHelpInstance <> 0 THEN WinDestroyHelpInstance(hwndHelpInstance);
  485. END;
  486.  
  487.  /*
  488.    einige mögliche Parameter für SendHelpMessage
  489.    HM_HELP_INDEX     zeigt Index
  490.    HM_HELP_CONTENTS, zeigt Inhalt
  491.    HM_DISPLAY_HELP   zeigt Hilfe für Hilfefunktion (help for help)
  492.  */
  493. PROCEDURE SendHelpMessage (HelpMessage:LONG);
  494. BEGIN
  495.      if fHelpEnabled THEN
  496.       if WinSendMsg(hwndHelpInstance, HelpMessage, 0, 0)<>0
  497.         then InfoBox ('Failed to display help panel.');
  498. END;
  499.  
  500.  /*
  501.    Parameter sind die Panel ID's, definiert über die ID Punktbefehle
  502.    im MAKEIPF Quelltext
  503.  */
  504. PROCEDURE DisplayHelpPanel (PanelID:LONG);
  505. BEGIN
  506.      if fHelpEnabled then
  507.        if WinSendMsg(hwndHelpInstance, HM_DISPLAY_HELP,
  508.           MPFROMLONG(MAKELONG(PanelID, 0)),
  509.           MPFROMSHORT(HM_RESOURCEID))<>0
  510.            then InfoBox ('Failed to display help panel.');
  511. END;
  512.  
  513.  
  514. BEGIN
  515. END.