home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / bpos13.zip / pmhelp.pas < prev    next >
Pascal/Delphi Source File  |  1993-11-24  |  14KB  |  279 lines

  1. {**************************************************************************\
  2. *
  3. * Module Name: PMHELP.H
  4. *
  5. * OS/2 Information Presentation Facility (IPF) for providing Help
  6. *
  7. * Copyright (c) International Business Machines Corporation 1989, 1990
  8. *
  9. *****************************************************************************
  10. }
  11. {| Version:   1.00
  12.  | Original translation: Peter Sawatzki (ps)
  13.  | Contributing:
  14.  |   Peter Sawatzki ps
  15.  |
  16.  | change history:
  17.  | Date:    Ver: Author:
  18.  | 11/11/93 1.00 ps     original translation by ps
  19. }
  20. Unit PmHelp;
  21. Interface
  22. Uses
  23.   Os2Def;
  24. Type
  25. {****************************************************************************}
  26. { HelpSubTable entry structure                                               }
  27. {****************************************************************************}
  28.   HELPSUBTABLE = Integer;
  29.   pHELPSUBTABLE = ^HELPSUBTABLE;
  30.  
  31. {****************************************************************************}
  32. { HelpTable entry structure                                                  }
  33. {****************************************************************************}
  34.  
  35.   HELPTABLE = Record
  36.     idAppWindow: USHORT;
  37.     phstHelpSubTable: pHELPSUBTABLE;
  38.     idExtPanel: USHORT
  39.   End;
  40.   pHELPTABLE = ^HELPTABLE;
  41.  
  42. {****************************************************************************}
  43. { IPF Initialization Structure used on the                                   }
  44. { WinCreateHelpInstance() call.                                              }
  45. {****************************************************************************}
  46.  
  47.   HELPINIT = Record
  48.     cb: USHORT;
  49.     ulReturnCode: ULONG;
  50.     pszTutorialName: pSZ;
  51.     phtHelpTable: pHELPTABLE;
  52.     hmodHelpTableModule,
  53.     hmodAccelActionBarModule: HMODULE;
  54.     idAccelTable,
  55.     idActionBar: USHORT;
  56.     pszHelpWindowTitle:pSZ;
  57.     usShowPanelId: USHORT;
  58.     pszHelpLibraryName: pSZ
  59.   End;
  60.   pHELPINIT = HELPINIT;
  61.  
  62. Const
  63. {****************************************************************************}
  64. { Search parent chain indicator for HM_SET_ACTIVE_WINDOW message.            }
  65. {****************************************************************************}
  66.   HWND_PARENT = HWND(0);
  67.  
  68. {****************************************************************************}
  69. { Constants used to define whether user wants to display panel using         }
  70. { panel number or panel name.                                                }
  71. {****************************************************************************}
  72.   HM_RESOURCEID          = 0;
  73.   HM_PANELNAME           = 1;
  74.   HMPANELTYPE_NUMBER     = 0;
  75.   HMPANELTYPE_NAME       = 1;
  76.  
  77. {****************************************************************************}
  78. { Constants used to define how the panel IDs are displayed on                }
  79. { help panels.                                                               }
  80. {****************************************************************************}
  81.  
  82.   CMIC_HIDE_PANEL_ID      = $0000;
  83.   CMIC_SHOW_PANEL_ID      = $0001;
  84.   CMIC_TOGGLE_PANEL_ID    = $0002;
  85.  
  86. {****************************************************************************}
  87. { Window Help function declarations.                                         }
  88. {****************************************************************************}
  89.  
  90. Function  WinDestroyHelpInstance(hwndHelpInstance: HWND): BOOL;
  91. Function  WinCreateHelpInstance(_hab: HAB; phinitHMInitStructure: PHELPINIT): HWND;
  92. Function  WinAssociateHelpInstance(hwndHelpInstance, hwndApp: HWND): BOOL;
  93. Function  WinQueryHelpInstance(hwndApp: HWND): HWND;
  94. Function  WinLoadHelpTable (hwndHelpInstance: HWND; idHelpTable: USHORT;
  95.                             Module: HMODULE): BOOL;
  96. Function  WinCreateHelpTable (hwndHelpInstance: HWND; phtHelpTable: PHELPTABLE): BOOL;
  97.  
  98. Const
  99. {****************************************************************************}
  100. { IPF message base.                                                          }
  101. {****************************************************************************}
  102.   HM_MSG_BASE             = $0220;
  103.  
  104. {****************************************************************************}
  105. { Messages applications can send to the IPF.                                 }
  106. {****************************************************************************}
  107.  
  108.   HM_DISMISS_WINDOW            = HM_MSG_BASE+$0001;
  109.   HM_DISPLAY_HELP              = HM_MSG_BASE+$0002;
  110.   HM_EXT_HELP                  = HM_MSG_BASE+$0003;
  111.   HM_SET_ACTIVE_WINDOW         = HM_MSG_BASE+$0004;
  112.   HM_LOAD_HELP_TABLE           = HM_MSG_BASE+$0005;
  113.   HM_CREATE_HELP_TABLE         = HM_MSG_BASE+$0006;
  114.   HM_SET_HELP_WINDOW_TITLE     = HM_MSG_BASE+$0007;
  115.   HM_SET_SHOW_PANEL_ID         = HM_MSG_BASE+$0008;
  116.   HM_REPLACE_HELP_FOR_HELP     = HM_MSG_BASE+$0009;
  117.   HM_HELP_INDEX                = HM_MSG_BASE+$000a;
  118.   HM_HELP_CONTENTS             = HM_MSG_BASE+$000b;
  119.   HM_KEYS_HELP                 = HM_MSG_BASE+$000c;
  120.   HM_SET_HELP_LIBRARY_NAME     = HM_MSG_BASE+$000d;
  121.  
  122. {****************************************************************************}
  123. { Messages the IPF sends to the applications active window                   }
  124. { as defined by the IPF.                                                     }
  125. {****************************************************************************}
  126.  
  127.   HM_ERROR                     = HM_MSG_BASE+$000e;
  128.   HM_HELPSUBITEM_NOT_FOUND     = HM_MSG_BASE+$000f;
  129.   HM_QUERY_KEYS_HELP           = HM_MSG_BASE+$0010;
  130.   HM_TUTORIAL                  = HM_MSG_BASE+$0011;
  131.   HM_EXT_HELP_UNDEFINED        = HM_MSG_BASE+$0012;
  132.   HM_ACTIONBAR_COMMAND         = HM_MSG_BASE+$0013;
  133.   HM_INFORM                    = HM_MSG_BASE+$0014;
  134.  
  135. {****************************************************************************}
  136. { HMERR_NO_FRAME_WND_IN_CHAIN - There is no frame window in the              }
  137. { window chain from which to find or set the associated help                 }
  138. { instance.                                                                  }
  139. {****************************************************************************}
  140.  
  141.   HMERR_NO_FRAME_WND_IN_CHAIN              = $00001001;
  142.  
  143. {****************************************************************************}
  144. { HMERR_INVALID_ASSOC_APP_WND - The application window handle                }
  145. { specified on the WinAssociateHelpInstance() call is not a valid            }
  146. { window handle.                                                             }
  147. {****************************************************************************}
  148.  
  149.   HMERR_INVALID_ASSOC_APP_WND              = $00001002;
  150.  
  151. {****************************************************************************}
  152. { HMERR_INVALID_ASSOC_HELP_INST - The help instance handle specified         }
  153. { on the WinAssociateHelpInstance() call is not a valid                      }
  154. { window handle.                                                             }
  155. {****************************************************************************}
  156.  
  157.   HMERR_INVALID_ASSOC_HELP_INST            = $00001003;
  158.  
  159. {****************************************************************************}
  160. { HMERR_INVALID_DESTROY_HELP_INST - The window handle specified              }
  161. { as the help instance to destroy is not of the help instance class.         }
  162. {****************************************************************************}
  163.  
  164.   HMERR_INVALID_DESTROY_HELP_INST          = $00001004;
  165.  
  166. {****************************************************************************}
  167. { HMERR_NO_HELP_INST_IN_CHAIN - The parent or owner chain of the             }
  168. { application window specified does not have a help instance                 }
  169. { associated with it.                                                        }
  170. {****************************************************************************}
  171.  
  172.   HMERR_NO_HELP_INST_IN_CHAIN              = $00001005;
  173.  
  174. {****************************************************************************}
  175. { HMERR_INVALID_HELP_INSTANCE_HDL - The handle specified to be a             }
  176. { help instance does not have the class name of a IPF                        }
  177. { help instance.                                                             }
  178. {****************************************************************************}
  179.  
  180.   HMERR_INVALID_HELP_INSTANCE_HDL          = $00001006;
  181.  
  182. {****************************************************************************}
  183. { HMERR_INVALID_QUERY_APP_WND - The application window specified on          }
  184. { a WinQueryHelpInstance() call is not a valid window handle.                }
  185. {****************************************************************************}
  186.  
  187.   HMERR_INVALID_QUERY_APP_WND              = $00001007;
  188.  
  189. {****************************************************************************}
  190. { HMERR_HELP_INST_CALLED_INVALID -  The handle of the help instance          }
  191. { specified on an API call to the IPF does not have the                      }
  192. { class name of an IPF help instance.                                        }
  193. {****************************************************************************}
  194.  
  195.   HMERR_HELP_INST_CALLED_INVALID           = $00001008;
  196.   HMERR_HELPTABLE_UNDEFINE                 = $00001009;
  197.   HMERR_HELP_INSTANCE_UNDEFINE             = $0000100a;
  198.   HMERR_HELPITEM_NOT_FOUND                 = $0000100b;
  199.   HMERR_INVALID_HELPSUBITEM_SIZE           = $0000100c;
  200.   HMERR_HELPSUBITEM_NOT_FOUND              = $0000100d;
  201.  
  202. {****************************************************************************}
  203. { HMERR_INDEX_NOT_FOUND - No index in library file.                          }
  204. {****************************************************************************}
  205.  
  206.   HMERR_INDEX_NOT_FOUND                    = $00002001;
  207.  
  208. {****************************************************************************}
  209. { HMERR_CONTENT_NOT_FOUND - Library file does not have any contents.         }
  210. {****************************************************************************}
  211.  
  212.   HMERR_CONTENT_NOT_FOUND                  = $00002002;
  213.  
  214. {****************************************************************************}
  215. { HMERR_OPEN_LIB_FILE     - Cannot open library file.                        }
  216. {****************************************************************************}
  217.  
  218.   HMERR_OPEN_LIB_FILE                      = $00002003;
  219.  
  220. {****************************************************************************}
  221. { HMERR_READ_LIB_FILE     - Cannot read library file.                        }
  222. {****************************************************************************}
  223.  
  224.   HMERR_READ_LIB_FILE                      = $00002004;
  225.  
  226. {****************************************************************************}
  227. { HMERR_CLOSE_LIB_FILE    - Cannot close library file.                       }
  228. {****************************************************************************}
  229.  
  230.   HMERR_CLOSE_LIB_FILE                     = $00002005;
  231.  
  232. {****************************************************************************}
  233. { HMERR_INVALID_LIB_FILE  - Improper library file provided.                  }
  234. {****************************************************************************}
  235.  
  236.   HMERR_INVALID_LIB_FILE                   = $00002006;
  237.  
  238. {****************************************************************************}
  239. { HMERR_NO_MEMORY - Unable to allocate the requested amount of memory.       }
  240. {****************************************************************************}
  241.  
  242.   HMERR_NO_MEMORY                          = $00002007;
  243.  
  244. {****************************************************************************}
  245. { HMERR_ALLOCATE_SEGMENT - Unable                                            }
  246. { to allocate a segment of memory for memory allocation requested            }
  247. { from the IPF.                                                              }
  248. {****************************************************************************}
  249.  
  250.   HMERR_ALLOCATE_SEGMENT                   = $00002008;
  251.  
  252. {****************************************************************************}
  253. { HMERR_FREE_MEMORY - Unable to free allocated  memory.                      }
  254. {****************************************************************************}
  255.  
  256.   HMERR_FREE_MEMORY                        = $00002009;
  257.  
  258. {****************************************************************************}
  259. { HMERR_PANEL_NOT_FOUND  - Unable                                            }
  260. { to find a help panel requested to IPF.                                     }
  261. {****************************************************************************}
  262.  
  263.   HMERR_PANEL_NOT_FOUND                    = $00002010;
  264.  
  265. {****************************************************************************}
  266. { HMERR_DATABASE_NOT_OPEN - Unable to read the unopened database.            }
  267. {****************************************************************************}
  268.  
  269.   HMERR_DATABASE_NOT_OPEN                  = $00002011;
  270.  
  271. Implementation
  272. Function WinCreateHelpInstance;    External 'HELPMGR' Index 1;
  273. Function WinDestroyHelpInstance;   External 'HELPMGR' Index 2;
  274. Function WinQueryHelpInstance;     External 'HELPMGR' Index 3;
  275. Function WinAssociateHelpInstance; External 'HELPMGR' Index 4;
  276. Function WinLoadHelpTable;         External 'HELPMGR' Index 5;
  277. Function WinCreateHelpTable;       External 'HELPMGR' Index 6;
  278. End.
  279.