JwaHtmlHelp.pas
上传用户:davidchvip
上传日期:2009-07-28
资源大小:1749k
文件大小:33k
源码类别:

Windows编程

开发平台:

Delphi

  1. {******************************************************************************}
  2. {                                                                       }
  3. { HTML Help API interface Unit for Object Pascal                               }
  4. {                                                                       }
  5. { Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft          }
  6. { Corporation. All Rights Reserved.                                            }
  7. {                 }
  8. { The original file is: htmlhelp.h, released July 2000. The original Pascal    }
  9. { code is: HtmlHelp.pas, released September 2000. The initial developer of the }
  10. { Pascal code is Marcel van Brakel (brakelm@chello.nl).                        }
  11. {                                                                              }
  12. { Portions created by Marcel van Brakel are Copyright (C) 1999-2001            }
  13. { Marcel van Brakel. All Rights Reserved.                                      }
  14. {                 }
  15. { Contributor(s): Robert Chandler  (robert@helpware.net)                       }
  16. {    Kurt Senfer (ks@siemens.dk)                          }
  17. {                 }
  18. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
  19. {                }
  20. { You may retrieve the latest version of this file at the Project JEDI home    }
  21. { page, located at http://delphi-jedi.org or my personal homepage located at   }
  22. { http://members.chello.nl/m.vanbrakel2                                        }
  23. {                }
  24. { The contents of this file are used with permission, subject to the Mozilla   }
  25. { Public License Version 1.1 (the "License"); you may not use this file except }
  26. { in compliance with the License. You may obtain a copy of the License at      }
  27. { http://www.mozilla.org/MPL/MPL-1.1.html                                      }
  28. {                                                                              }
  29. { Software distributed under the License is distributed on an "AS IS" basis,   }
  30. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  31. { the specific language governing rights and limitations under the License.    }
  32. {                                                                              }
  33. { Alternatively, the contents of this file may be used under the terms of the  }
  34. { GNU Lesser General Public License (the  "LGPL License"), in which case the   }
  35. { provisions of the LGPL License are applicable instead of those above.        }
  36. { If you wish to allow use of your version of this file only under the terms   }
  37. { of the LGPL License and not to allow others to use your version of this file }
  38. { under the MPL, indicate your decision by deleting  the provisions above and  }
  39. { replace  them with the notice and other provisions required by the LGPL      }
  40. { License.  If you do not delete the provisions above, a recipient may use     }
  41. { your version of this file under either the MPL or the LGPL License.          }
  42. {                 }
  43. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  44. {                 }
  45. {******************************************************************************}
  46. unit JwaHtmlHelp;
  47. interface
  48. {$WEAKPACKAGEUNIT}
  49. (*$HPPEMIT ''*)
  50. (*$HPPEMIT '#include "htmlhelp.h"'*)
  51. (*$HPPEMIT ''*)
  52. (*$HPPEMIT 'typedef struct tagHH_LAST_ERROR'*)
  53. (*$HPPEMIT '{'*)
  54. (*$HPPEMIT '  int     cbStruct ;'*)
  55. (*$HPPEMIT '  HRESULT hr ;'*)
  56. (*$HPPEMIT '  BSTR    description ;'*)
  57. (*$HPPEMIT '} HH_LAST_ERROR ;'*)
  58. (*$HPPEMIT ''*)
  59. {$I WINDEFINES.INC}
  60. {$DEFINE HTMLHELP12}
  61. uses
  62.   JwaWinType, JwaWinUser{$IFDEF VER140}, Variants{$ENDIF};
  63. // Commands to pass to HtmlHelp()
  64. const
  65.   HH_DISPLAY_TOPIC           = $0000;
  66.   {$EXTERNALSYM HH_DISPLAY_TOPIC}
  67.   HH_HELP_FINDER             = $0000;      // WinHelp equivalent
  68.   {$EXTERNALSYM HH_HELP_FINDER}
  69.   HH_DISPLAY_TOC             = $0001;      // not currently implemented
  70.   {$EXTERNALSYM HH_DISPLAY_TOC}
  71.   HH_DISPLAY_INDEX           = $0002;      // not currently implemented
  72.   {$EXTERNALSYM HH_DISPLAY_INDEX}
  73.   HH_DISPLAY_SEARCH          = $0003;      // not currently implemented
  74.   {$EXTERNALSYM HH_DISPLAY_SEARCH}
  75.   HH_SET_WIN_TYPE            = $0004;
  76.   {$EXTERNALSYM HH_SET_WIN_TYPE}
  77.   HH_GET_WIN_TYPE            = $0005;
  78.   {$EXTERNALSYM HH_GET_WIN_TYPE}
  79.   HH_GET_WIN_HANDLE          = $0006;
  80.   {$EXTERNALSYM HH_GET_WIN_HANDLE}
  81.   HH_ENUM_INFO_TYPE          = $0007;      // Get Info type name, call repeatedly to enumerate, -1 at end
  82.   {$EXTERNALSYM HH_ENUM_INFO_TYPE}
  83.   HH_SET_INFO_TYPE           = $0008;      // Add Info type to filter.
  84.   {$EXTERNALSYM HH_SET_INFO_TYPE}
  85.   HH_SYNC                    = $0009;
  86.   {$EXTERNALSYM HH_SYNC}
  87. {$IFDEF HTMLHELP11}
  88.   HH_ADD_NAV_UI              = $000A;      // not currently implemented
  89.   {$EXTERNALSYM HH_ADD_NAV_UI}
  90.   HH_ADD_BUTTON              = $000B;      // not currently implemented
  91.   {$EXTERNALSYM HH_ADD_BUTTON}
  92.   HH_GETBROWSER_APP          = $000C;      // not currently implemented
  93.   {$EXTERNALSYM HH_GETBROWSER_APP}
  94. {$ENDIF}
  95. {$IFDEF HTMLHELP12}
  96.   HH_RESERVED1               = $000A;
  97.   {$EXTERNALSYM HH_RESERVED1}
  98.   HH_RESERVED2               = $000B;
  99.   {$EXTERNALSYM HH_RESERVED2}
  100.   HH_RESERVED3               = $000C;
  101.   {$EXTERNALSYM HH_RESERVED3}
  102. {$ENDIF}
  103.   HH_KEYWORD_LOOKUP          = $000D;
  104.   {$EXTERNALSYM HH_KEYWORD_LOOKUP}
  105.   HH_DISPLAY_TEXT_POPUP      = $000E;      // display string resource id or text in a popup window
  106.   {$EXTERNALSYM HH_DISPLAY_TEXT_POPUP}
  107.   HH_HELP_CONTEXT            = $000F;      // display mapped numeric value in dwData
  108.   {$EXTERNALSYM HH_HELP_CONTEXT}
  109.   HH_TP_HELP_CONTEXTMENU     = $0010;      // text popup help, same as WinHelp HELP_CONTEXTMENU
  110.   {$EXTERNALSYM HH_TP_HELP_CONTEXTMENU}
  111.   HH_TP_HELP_WM_HELP         = $0011;      // text popup help, same as WinHelp HELP_WM_HELP
  112.   {$EXTERNALSYM HH_TP_HELP_WM_HELP}
  113.   HH_CLOSE_ALL               = $0012;      // close all windows opened directly or indirectly by the caller
  114.   {$EXTERNALSYM HH_CLOSE_ALL}
  115.   HH_ALINK_LOOKUP            = $0013;      // ALink version of HH_KEYWORD_LOOKUP
  116.   {$EXTERNALSYM HH_ALINK_LOOKUP}
  117.   HH_GET_LAST_ERROR          = $0014;      // not currently implemented, See HHERROR.h
  118.   {$EXTERNALSYM HH_GET_LAST_ERROR}
  119.   HH_ENUM_CATEGORY           = $0015;      // Get category name, call repeatedly to enumerate, -1 at end
  120.   {$EXTERNALSYM HH_ENUM_CATEGORY}
  121.   HH_ENUM_CATEGORY_IT        = $0016;      // Get category info type members, call repeatedly to enumerate, -1 at end
  122.   {$EXTERNALSYM HH_ENUM_CATEGORY_IT}
  123.   HH_RESET_IT_FILTER         = $0017;      // Clear the info type filter of all info types.
  124.   {$EXTERNALSYM HH_RESET_IT_FILTER}
  125.   HH_SET_INCLUSIVE_FILTER    = $0018;      // set inclusive filtering method for untyped topics to be included in display
  126.   {$EXTERNALSYM HH_SET_INCLUSIVE_FILTER}
  127.   HH_SET_EXCLUSIVE_FILTER    = $0019;      // set exclusive filtering method for untyped topics to be excluded from display
  128.   {$EXTERNALSYM HH_SET_EXCLUSIVE_FILTER}
  129. {$IFDEF HTMLHELP11}
  130.   HH_SET_GUID                = $001A;      // For Microsoft Installer -- dwData is a pointer to the GUID string
  131.   {$EXTERNALSYM HH_SET_GUID}
  132. {$ENDIF}
  133. {$IFDEF HTMLHELP12}
  134.   HH_INITIALIZE              = $001C;      // Initializes the help system.
  135.   {$EXTERNALSYM HH_INITIALIZE}
  136.   HH_UNINITIALIZE            = $001D;      // Uninitializes the help system.
  137.   {$EXTERNALSYM HH_UNINITIALIZE}
  138.   HH_PRETRANSLATEMESSAGE     = $00FD;      // Pumps messages. (NULL, NULL, MSG*).
  139.   {$EXTERNALSYM HH_PRETRANSLATEMESSAGE}
  140.   HH_SET_GLOBAL_PROPERTY     = $00FC;      // Set a global property. (NULL, NULL, HH_GPROP)
  141.   {$EXTERNALSYM HH_SET_GLOBAL_PROPERTY}
  142. {$ENDIF}
  143. {$IFDEF HTMLHELP11}
  144.   HH_INTERNAL                = $00FF;      // Used internally.
  145.   {$EXTERNALSYM HH_INTERNAL}
  146. {$ENDIF}
  147. {$IFDEF HTMLHELP12}
  148.   HHWIN_PROP_TAB_AUTOHIDESHOW = (1 shl 0); // Automatically hide/show tri-pane window
  149.   {$EXTERNALSYM HHWIN_PROP_TAB_AUTOHIDESHOW}
  150. {$ENDIF}
  151.   HHWIN_PROP_ONTOP           = (1 shl 1);  // Top-most window (not currently implemented)
  152.   {$EXTERNALSYM HHWIN_PROP_ONTOP}
  153.   HHWIN_PROP_NOTITLEBAR      = (1 shl 2);  // no title bar
  154.   {$EXTERNALSYM HHWIN_PROP_NOTITLEBAR}
  155.   HHWIN_PROP_NODEF_STYLES    = (1 shl 3);  // no default window styles (only HH_WINTYPE.dwStyles)
  156.   {$EXTERNALSYM HHWIN_PROP_NODEF_STYLES}
  157.   HHWIN_PROP_NODEF_EXSTYLES  = (1 shl 4);  // no default extended window styles (only HH_WINTYPE.dwExStyles)
  158.   {$EXTERNALSYM HHWIN_PROP_NODEF_EXSTYLES}
  159.   HHWIN_PROP_TRI_PANE        = (1 shl 5);  // use a tri-pane window
  160.   {$EXTERNALSYM HHWIN_PROP_TRI_PANE}
  161.   HHWIN_PROP_NOTB_TEXT       = (1 shl 6);  // no text on toolbar buttons
  162.   {$EXTERNALSYM HHWIN_PROP_NOTB_TEXT}
  163.   HHWIN_PROP_POST_QUIT       = (1 shl 7);  // post WM_QUIT message when window closes
  164.   {$EXTERNALSYM HHWIN_PROP_POST_QUIT}
  165.   HHWIN_PROP_AUTO_SYNC       = (1 shl 8);  // automatically ssync contents and index
  166.   {$EXTERNALSYM HHWIN_PROP_AUTO_SYNC}
  167.   HHWIN_PROP_TRACKING        = (1 shl 9);  // send tracking notification messages
  168.   {$EXTERNALSYM HHWIN_PROP_TRACKING}
  169.   HHWIN_PROP_TAB_SEARCH      = (1 shl 10); // include search tab in navigation pane
  170.   {$EXTERNALSYM HHWIN_PROP_TAB_SEARCH}
  171.   HHWIN_PROP_TAB_HISTORY     = (1 shl 11); // include history tab in navigation pane
  172.   {$EXTERNALSYM HHWIN_PROP_TAB_HISTORY}
  173. {$IFDEF HTMLHELP11}
  174.   HHWIN_PROP_TAB_BOOKMARKS   = (1 shl 12); // include bookmark tab in navigation pane
  175.   {$EXTERNALSYM HHWIN_PROP_TAB_BOOKMARKS}
  176. {$ENDIF}
  177. {$IFDEF HTMLHELP12}
  178.   HHWIN_PROP_TAB_FAVORITES   = (1 shl 12); // include favorites tab in navigation pane
  179.   {$EXTERNALSYM HHWIN_PROP_TAB_FAVORITES}
  180. {$ENDIF}
  181.   HHWIN_PROP_CHANGE_TITLE    = (1 shl 13); // Put current HTML title in title bar
  182.   {$EXTERNALSYM HHWIN_PROP_CHANGE_TITLE}
  183.   HHWIN_PROP_NAV_ONLY_WIN    = (1 shl 14); // Only display the navigation window
  184.   {$EXTERNALSYM HHWIN_PROP_NAV_ONLY_WIN}
  185.   HHWIN_PROP_NO_TOOLBAR      = (1 shl 15); // Don't display a toolbar
  186.   {$EXTERNALSYM HHWIN_PROP_NO_TOOLBAR}
  187.   HHWIN_PROP_MENU            = (1 shl 16); // Menu
  188.   {$EXTERNALSYM HHWIN_PROP_MENU}
  189.   HHWIN_PROP_TAB_ADVSEARCH   = (1 shl 17); // Advanced FTS UI.
  190.   {$EXTERNALSYM HHWIN_PROP_TAB_ADVSEARCH}
  191.   HHWIN_PROP_USER_POS        = (1 shl 18); // After initial creation, user controls window size/Position
  192.   {$EXTERNALSYM HHWIN_PROP_USER_POS}
  193. {$IFDEF HTMLHELP12}
  194.   HHWIN_PROP_TAB_CUSTOM1     = (1 shl 19); // Use custom tab #1
  195.   {$EXTERNALSYM HHWIN_PROP_TAB_CUSTOM1}
  196.   HHWIN_PROP_TAB_CUSTOM2     = (1 shl 20); // Use custom tab #2
  197.   {$EXTERNALSYM HHWIN_PROP_TAB_CUSTOM2}
  198.   HHWIN_PROP_TAB_CUSTOM3     = (1 shl 21); // Use custom tab #3
  199.   {$EXTERNALSYM HHWIN_PROP_TAB_CUSTOM3}
  200.   HHWIN_PROP_TAB_CUSTOM4     = (1 shl 22); // Use custom tab #4
  201.   {$EXTERNALSYM HHWIN_PROP_TAB_CUSTOM4}
  202.   HHWIN_PROP_TAB_CUSTOM5     = (1 shl 23); // Use custom tab #5
  203.   {$EXTERNALSYM HHWIN_PROP_TAB_CUSTOM5}
  204.   HHWIN_PROP_TAB_CUSTOM6     = (1 shl 24); // Use custom tab #6
  205.   {$EXTERNALSYM HHWIN_PROP_TAB_CUSTOM6}
  206.   HHWIN_PROP_TAB_CUSTOM7     = (1 shl 25); // Use custom tab #7
  207.   {$EXTERNALSYM HHWIN_PROP_TAB_CUSTOM7}
  208.   HHWIN_PROP_TAB_CUSTOM8     = (1 shl 26); // Use custom tab #8
  209.   {$EXTERNALSYM HHWIN_PROP_TAB_CUSTOM8}
  210.   HHWIN_PROP_TAB_CUSTOM9     = (1 shl 27); // Use custom tab #9
  211.   {$EXTERNALSYM HHWIN_PROP_TAB_CUSTOM9}
  212.   HHWIN_TB_MARGIN            = (1 shl 28); // the window type has a margin
  213.   {$EXTERNALSYM HHWIN_TB_MARGIN}
  214. {$ENDIF}
  215.   HHWIN_PARAM_PROPERTIES     = (1 shl 1);  // valid fsWinProperties
  216.   {$EXTERNALSYM HHWIN_PARAM_PROPERTIES}
  217.   HHWIN_PARAM_STYLES         = (1 shl 2);  // valid dwStyles
  218.   {$EXTERNALSYM HHWIN_PARAM_STYLES}
  219.   HHWIN_PARAM_EXSTYLES       = (1 shl 3);  // valid dwExStyles
  220.   {$EXTERNALSYM HHWIN_PARAM_EXSTYLES}
  221.   HHWIN_PARAM_RECT           = (1 shl 4);  // valid rcWindowPos
  222.   {$EXTERNALSYM HHWIN_PARAM_RECT}
  223.   HHWIN_PARAM_NAV_WIDTH      = (1 shl 5);  // valid iNavWidth
  224.   {$EXTERNALSYM HHWIN_PARAM_NAV_WIDTH}
  225.   HHWIN_PARAM_SHOWSTATE      = (1 shl 6);  // valid nShowState
  226.   {$EXTERNALSYM HHWIN_PARAM_SHOWSTATE}
  227.   HHWIN_PARAM_INFOTYPES      = (1 shl 7);  // valid apInfoTypes
  228.   {$EXTERNALSYM HHWIN_PARAM_INFOTYPES}
  229.   HHWIN_PARAM_TB_FLAGS       = (1 shl 8);  // valid fsToolBarFlags
  230.   {$EXTERNALSYM HHWIN_PARAM_TB_FLAGS}
  231.   HHWIN_PARAM_EXPANSION      = (1 shl 9);  // valid fNotExpanded
  232.   {$EXTERNALSYM HHWIN_PARAM_EXPANSION}
  233.   HHWIN_PARAM_TABPOS         = (1 shl 10); // valid tabpos
  234.   {$EXTERNALSYM HHWIN_PARAM_TABPOS}
  235.   HHWIN_PARAM_TABORDER       = (1 shl 11); // valid taborder
  236.   {$EXTERNALSYM HHWIN_PARAM_TABORDER}
  237.   HHWIN_PARAM_HISTORY_COUNT  = (1 shl 12); // valid cHistory
  238.   {$EXTERNALSYM HHWIN_PARAM_HISTORY_COUNT}
  239.   HHWIN_PARAM_CUR_TAB        = (1 shl 13); // valid curNavType
  240.   {$EXTERNALSYM HHWIN_PARAM_CUR_TAB}
  241.   HHWIN_BUTTON_EXPAND        = (1 shl 1);  // Expand/contract button
  242.   {$EXTERNALSYM HHWIN_BUTTON_EXPAND}
  243.   HHWIN_BUTTON_BACK          = (1 shl 2);  // Back button
  244.   {$EXTERNALSYM HHWIN_BUTTON_BACK}
  245.   HHWIN_BUTTON_FORWARD       = (1 shl 3);  // Forward button
  246.   {$EXTERNALSYM HHWIN_BUTTON_FORWARD}
  247.   HHWIN_BUTTON_STOP          = (1 shl 4);  // Stop button
  248.   {$EXTERNALSYM HHWIN_BUTTON_STOP}
  249.   HHWIN_BUTTON_REFRESH       = (1 shl 5);  // Refresh button
  250.   {$EXTERNALSYM HHWIN_BUTTON_REFRESH}
  251.   HHWIN_BUTTON_HOME          = (1 shl 6);  // Home button
  252.   {$EXTERNALSYM HHWIN_BUTTON_HOME}
  253.   HHWIN_BUTTON_BROWSE_FWD    = (1 shl 7);  // not implemented
  254.   {$EXTERNALSYM HHWIN_BUTTON_BROWSE_FWD}
  255.   HHWIN_BUTTON_BROWSE_BCK    = (1 shl 8);  // not implemented
  256.   {$EXTERNALSYM HHWIN_BUTTON_BROWSE_BCK}
  257.   HHWIN_BUTTON_NOTES         = (1 shl 9);  // not implemented
  258.   {$EXTERNALSYM HHWIN_BUTTON_NOTES}
  259.   HHWIN_BUTTON_CONTENTS      = (1 shl 10); // not implemented
  260.   {$EXTERNALSYM HHWIN_BUTTON_CONTENTS}
  261.   HHWIN_BUTTON_SYNC          = (1 shl 11); // Sync button
  262.   {$EXTERNALSYM HHWIN_BUTTON_SYNC}
  263.   HHWIN_BUTTON_OPTIONS       = (1 shl 12); // Options button
  264.   {$EXTERNALSYM HHWIN_BUTTON_OPTIONS}
  265.   HHWIN_BUTTON_PRINT         = (1 shl 13); // Print button
  266.   {$EXTERNALSYM HHWIN_BUTTON_PRINT}
  267.   HHWIN_BUTTON_INDEX         = (1 shl 14); // not implemented
  268.   {$EXTERNALSYM HHWIN_BUTTON_INDEX}
  269.   HHWIN_BUTTON_SEARCH        = (1 shl 15); // not implemented
  270.   {$EXTERNALSYM HHWIN_BUTTON_SEARCH}
  271.   HHWIN_BUTTON_HISTORY       = (1 shl 16); // not implemented
  272.   {$EXTERNALSYM HHWIN_BUTTON_HISTORY}
  273. {$IFDEF HTMLHELP11}
  274.   HHWIN_BUTTON_BOOKMARKS     = (1 shl 17); // not implemented
  275.   {$EXTERNALSYM HHWIN_BUTTON_BOOKMARKS}
  276. {$ENDIF}
  277. {$IFDEF HTMLHELP12}
  278.   HHWIN_BUTTON_FAVORITES     = (1 shl 17); // not implemented
  279.   {$EXTERNALSYM HHWIN_BUTTON_FAVORITES}
  280. {$ENDIF}
  281.   HHWIN_BUTTON_JUMP1         = (1 shl 18);
  282.   {$EXTERNALSYM HHWIN_BUTTON_JUMP1}
  283.   HHWIN_BUTTON_JUMP2         = (1 shl 19);
  284.   {$EXTERNALSYM HHWIN_BUTTON_JUMP2}
  285.   HHWIN_BUTTON_ZOOM          = (1 shl 20);
  286.   {$EXTERNALSYM HHWIN_BUTTON_ZOOM}
  287.   HHWIN_BUTTON_TOC_NEXT      = (1 shl 21);
  288.   {$EXTERNALSYM HHWIN_BUTTON_TOC_NEXT}
  289.   HHWIN_BUTTON_TOC_PREV      = (1 shl 22);
  290.   {$EXTERNALSYM HHWIN_BUTTON_TOC_PREV}
  291.   HHWIN_DEF_BUTTONS = HHWIN_BUTTON_EXPAND or HHWIN_BUTTON_BACK or
  292.                       HHWIN_BUTTON_OPTIONS or HHWIN_BUTTON_PRINT;
  293.   {$EXTERNALSYM HHWIN_DEF_BUTTONS}
  294. // Button IDs
  295.   IDTB_EXPAND       = 200;
  296.   {$EXTERNALSYM IDTB_EXPAND}
  297.   IDTB_CONTRACT     = 201;
  298.   {$EXTERNALSYM IDTB_CONTRACT}
  299.   IDTB_STOP         = 202;
  300.   {$EXTERNALSYM IDTB_STOP}
  301.   IDTB_REFRESH      = 203;
  302.   {$EXTERNALSYM IDTB_REFRESH}
  303.   IDTB_BACK         = 204;
  304.   {$EXTERNALSYM IDTB_BACK}
  305.   IDTB_HOME         = 205;
  306.   {$EXTERNALSYM IDTB_HOME}
  307.   IDTB_SYNC         = 206;
  308.   {$EXTERNALSYM IDTB_SYNC}
  309.   IDTB_PRINT        = 207;
  310.   {$EXTERNALSYM IDTB_PRINT}
  311.   IDTB_OPTIONS      = 208;
  312.   {$EXTERNALSYM IDTB_OPTIONS}
  313.   IDTB_FORWARD      = 209;
  314.   {$EXTERNALSYM IDTB_FORWARD}
  315.   IDTB_NOTES        = 210;                 // not implemented
  316.   {$EXTERNALSYM IDTB_NOTES}
  317.   IDTB_BROWSE_FWD   = 211;
  318.   {$EXTERNALSYM IDTB_BROWSE_FWD}
  319.   IDTB_BROWSE_BACK  = 212;
  320.   {$EXTERNALSYM IDTB_BROWSE_BACK}
  321.   IDTB_CONTENTS     = 213;                 // not implemented
  322.   {$EXTERNALSYM IDTB_CONTENTS}
  323.   IDTB_INDEX        = 214;                 // not implemented
  324.   {$EXTERNALSYM IDTB_INDEX}
  325.   IDTB_SEARCH       = 215;                 // not implemented
  326.   {$EXTERNALSYM IDTB_SEARCH}
  327.   IDTB_HISTORY      = 216;                 // not implemented
  328.   {$EXTERNALSYM IDTB_HISTORY}
  329. {$IFDEF HTMLHELP11}
  330.   IDTB_BOOKMARKS    = 217;                 // not implemented
  331.   {$EXTERNALSYM IDTB_BOOKMARKS}
  332. {$ENDIF}
  333. {$IFDEF HTMLHELP12}
  334.   IDTB_FAVORITES    = 217;                 // not implemented
  335.   {$EXTERNALSYM IDTB_FAVORITES}
  336. {$ENDIF}
  337.   IDTB_JUMP1        = 218;
  338.   {$EXTERNALSYM IDTB_JUMP1}
  339.   IDTB_JUMP2        = 219;
  340.   {$EXTERNALSYM IDTB_JUMP2}
  341.   IDTB_CUSTOMIZE    = 221;
  342.   {$EXTERNALSYM IDTB_CUSTOMIZE}
  343.   IDTB_ZOOM         = 222;
  344.   {$EXTERNALSYM IDTB_ZOOM}
  345.   IDTB_TOC_NEXT     = 223;
  346.   {$EXTERNALSYM IDTB_TOC_NEXT}
  347.   IDTB_TOC_PREV     = 224;
  348.   {$EXTERNALSYM IDTB_TOC_PREV}
  349. // Notification codes
  350.   HHN_FIRST         = -860;
  351.   {$EXTERNALSYM HHN_FIRST}
  352.   HHN_LAST          = -879;
  353.   {$EXTERNALSYM HHN_LAST}
  354.   HHN_NAVCOMPLETE   = (HHN_FIRST - 0);
  355.   {$EXTERNALSYM HHN_NAVCOMPLETE}
  356.   HHN_TRACK         = (HHN_FIRST - 1);
  357.   {$EXTERNALSYM HHN_TRACK}
  358.   HHN_WINDOW_CREATE = (HHN_FIRST - 2);
  359.   {$EXTERNALSYM HHN_WINDOW_CREATE}
  360. type
  361.   PHHLastError = ^THHLastError;
  362.   tagHH_LAST_ERROR = packed record
  363.     cbStruct: INT;          // size of this structure
  364.     hr: HRESULT;            // the last error code.
  365.     description: LPWSTR;    // a description of the error (unicode string - BSTR).
  366.   end;
  367.   THHLastError = tagHH_LAST_ERROR;
  368.   PHHNNotify = ^THHNNotify;
  369.   tagHHN_NOTIFY = packed record
  370.     hdr: NMHDR;
  371.     pszUrl: PCSTR;                         // multibyte null-terminated string
  372.   end;
  373.   {$EXTERNALSYM tagHHN_NOTIFY}
  374.   HHN_NOTIFY = tagHHN_NOTIFY;
  375.   {$EXTERNALSYM HHN_NOTIFY}
  376.   THHNNotify = tagHHN_NOTIFY;
  377.   PHHPopup = ^THHPopup;
  378.   tagHH_POPUP = packed record
  379.     cbStruct: Integer;                     // sizeof this structure
  380.     hinst_: HINSTANCE;                     // instance handle for string resource
  381.     idString: UINT;                        // string resource id, or text id if pszFile is specified in HtmlHelp call
  382.     pszText: LPCTSTR;                      // used if idString is zero
  383.     pt: POINT;                             // top center of popup window
  384.     clrForeGround: COLORREF;               // use -1 for default
  385.     clrBackground: COLORREF;               // use -1 for default
  386.     rcMargins: RECT;                       // amount of space between edges of window and text, -1 for each member to ignore
  387.     pszFont: LPCTSTR;                      // facename, point size, char set, BOLD ITALIC UNDERLINE
  388.   end;
  389.   {$EXTERNALSYM tagHH_POPUP}
  390.   HH_POPUP = tagHH_POPUP;
  391.   {$EXTERNALSYM HH_POPUP}
  392.   THHPopup = tagHH_POPUP;
  393.   PHHAKLink = ^THHAKLink;
  394.   tagHH_AKLINK = packed record
  395.     cbStruct: Integer;                     // sizeof this structure
  396.     fReserved: BOOL;                       // must be FALSE (really!)
  397.     pszKeywords: LPCTSTR;                  // semi-colon separated keywords
  398.     pszUrl: LPCTSTR;                       // URL to jump to if no keywords found (may be NULL)
  399.     pszMsgText: LPCTSTR;                   // Message text to display in MessageBox if pszUrl is NULL and no keyword match
  400.     pszMsgTitle: LPCTSTR;                  // Message text to display in MessageBox if pszUrl is NULL and no keyword match
  401.     pszWindow: LPCTSTR;                    // Window to display URL in
  402.     fIndexOnFail: BOOL;                    // Displays index if keyword lookup fails.
  403.   end;
  404.   {$EXTERNALSYM tagHH_AKLINK}
  405.   HH_AKLINK = tagHH_AKLINK;
  406.   {$EXTERNALSYM HH_AKLINK}
  407.   THHAKLink = tagHH_AKLINK;
  408. const
  409.   HHWIN_NAVTYPE_TOC          = 0;
  410.   {$EXTERNALSYM HHWIN_NAVTYPE_TOC}
  411.   HHWIN_NAVTYPE_INDEX        = 1;
  412.   {$EXTERNALSYM HHWIN_NAVTYPE_INDEX}
  413.   HHWIN_NAVTYPE_SEARCH       = 2;
  414.   {$EXTERNALSYM HHWIN_NAVTYPE_SEARCH}
  415. {$IFDEF HTMLHELP11}
  416.   HHWIN_NAVTYPE_BOOKMARKS    = 3;
  417.   {$EXTERNALSYM HHWIN_NAVTYPE_BOOKMARKS}
  418.   HHWIN_NAVTYPE_HISTORY      = 4;          //not implemented
  419.   {$EXTERNALSYM HHWIN_NAVTYPE_HISTORY}
  420. {$ENDIF}
  421. {$IFDEF HTMLHELP12}
  422.   HHWIN_NAVTYPE_FAVORITES    = 3;
  423.   {$EXTERNALSYM HHWIN_NAVTYPE_FAVORITES}
  424.   HHWIN_NAVTYPE_HISTORY      = 4;          //not implemented
  425.   {$EXTERNALSYM HHWIN_NAVTYPE_HISTORY}
  426.   HHWIN_NAVTYPE_AUTHOR       = 5;
  427.   {$EXTERNALSYM HHWIN_NAVTYPE_AUTHOR}
  428.   HHWIN_NAVTYPE_CUSTOM_FIRST = 11;
  429.   {$EXTERNALSYM HHWIN_NAVTYPE_CUSTOM_FIRST}
  430. {$ENDIF}
  431.   IT_INCLUSIVE = 0;
  432.   {$EXTERNALSYM IT_INCLUSIVE}
  433.   IT_EXCLUSIVE = 1;
  434.   {$EXTERNALSYM IT_EXCLUSIVE}
  435.   IT_HIDDEN    = 2;
  436.   {$EXTERNALSYM IT_HIDDEN}
  437. type
  438.   PHHEnumIT = ^THHEnumIT;
  439.   tagHH_ENUM_IT = packed record
  440.     cbStruct: Integer;        // size of this structure
  441.     iType: Integer;           // the type of the information type ie. Inclusive, Exclusive, or Hidden
  442.     pszCatName: LPCSTR;       // Set to the name of the Category to enumerate the info types in a category; else NULL
  443.     pszITName: LPCSTR;        // volitile pointer to the name of the infotype. Allocated by call. Caller responsible for freeing
  444.     pszITDescription: LPCSTR; // volitile pointer to the description of the infotype.
  445.   end;
  446.   {$EXTERNALSYM tagHH_ENUM_IT}
  447.   HH_ENUM_IT = tagHH_ENUM_IT;
  448.   {$EXTERNALSYM HH_ENUM_IT}
  449.   PHH_ENUM_IT = ^tagHH_ENUM_IT;
  450.   {$EXTERNALSYM PHH_ENUM_IT}
  451.   THHEnumIT = tagHH_ENUM_IT;
  452.   PHHEnumCat = ^THHEnumCat;
  453.   tagHH_ENUM_CAT = packed record
  454.     cbStruct: Integer;         // size of this structure
  455.     pszCatName: LPCSTR;        // volitile pointer to the category name
  456.     pszCatDescription: LPCSTR; // volitile pointer to the category description
  457.   end;
  458.   {$EXTERNALSYM tagHH_ENUM_CAT}
  459.   HH_ENUM_CAT = tagHH_ENUM_CAT;
  460.   {$EXTERNALSYM HH_ENUM_CAT}
  461.   PHH_ENUM_CAT = ^tagHH_ENUM_CAT;
  462.   {$EXTERNALSYM PHH_ENUM_CAT}
  463.   THHEnumCat = tagHH_ENUM_CAT;
  464.   PHHSetInfoType = ^THHSetInfoType;
  465.   tagHH_SET_INFOTYPE = packed record
  466.     cbStruct: Integer;        // the size of this structure
  467.     pszCatName: LPCSTR;       // the name of the category, if any, the InfoType is a member of.
  468.     pszInfoTypeName: LPCSTR;  // the name of the info type to add to the filter
  469.   end;
  470.   {$EXTERNALSYM tagHH_SET_INFOTYPE}
  471.   HH_SET_INFOTYPE = tagHH_SET_INFOTYPE;
  472.   {$EXTERNALSYM HH_SET_INFOTYPE}
  473.   PHH_SET_INFOTYPE = ^tagHH_SET_INFOTYPE;
  474.   {$EXTERNALSYM PHH_SET_INFOTYPE}
  475.   THHSetInfoType = tagHH_SET_INFOTYPE;
  476.   HH_INFOTYPE = DWORD;
  477.   {$EXTERNALSYM HH_INFOTYPE}
  478.   PHH_INFOTYPE = ^HH_INFOTYPE;
  479.   {$EXTERNALSYM PHH_INFOTYPE}
  480.   PHHInfoType = ^THHInfoType;
  481.   THHInfoType = HH_INFOTYPE;
  482. const
  483.   HHWIN_NAVTAB_TOP    = 0;
  484.   {$EXTERNALSYM HHWIN_NAVTAB_TOP}
  485.   HHWIN_NAVTAB_LEFT   = 1;
  486.   {$EXTERNALSYM HHWIN_NAVTAB_LEFT}
  487.   HHWIN_NAVTAB_BOTTOM = 2;
  488.   {$EXTERNALSYM HHWIN_NAVTAB_BOTTOM}
  489.   HH_MAX_TABS         = 19;
  490.   {$EXTERNALSYM HH_MAX_TABS}
  491.   HH_TAB_CONTENTS     = 0;
  492.   {$EXTERNALSYM HH_TAB_CONTENTS}
  493.   HH_TAB_INDEX        = 1;
  494.   {$EXTERNALSYM HH_TAB_INDEX}
  495.   HH_TAB_SEARCH       = 2;
  496.   {$EXTERNALSYM HH_TAB_SEARCH}
  497. {$IFDEF HTMLHELP11}
  498.   HH_TAB_BOOKMARKS    = 3;
  499.   {$EXTERNALSYM HH_TAB_BOOKMARKS}
  500.   HH_TAB_HISTORY      = 4;
  501.   {$EXTERNALSYM HH_TAB_HISTORY}
  502. {$ENDIF}
  503. {$IFDEF HTMLHELP12}
  504.   HH_TAB_FAVORITES    = 3;
  505.   {$EXTERNALSYM HH_TAB_FAVORITES}
  506.   HH_TAB_HISTORY      = 4;
  507.   {$EXTERNALSYM HH_TAB_HISTORY}
  508.   HH_TAB_AUTHOR       = 5;
  509.   {$EXTERNALSYM HH_TAB_AUTHOR}
  510.   HH_TAB_CUSTOM_FIRST = 11;
  511.   {$EXTERNALSYM HH_TAB_CUSTOM_FIRST}
  512.   HH_TAB_CUSTOM_LAST  = HH_MAX_TABS;
  513.   {$EXTERNALSYM HH_TAB_CUSTOM_LAST}
  514.   HH_MAX_TABS_CUSTOM  = HH_TAB_CUSTOM_LAST - HH_TAB_CUSTOM_FIRST + 1;
  515.   {$EXTERNALSYM HH_MAX_TABS_CUSTOM}
  516. {$ENDIF}
  517. // HH_DISPLAY_SEARCH Command Related Structures and Constants
  518.   HH_FTS_DEFAULT_PROXIMITY = -1;
  519.   {$EXTERNALSYM HH_FTS_DEFAULT_PROXIMITY}
  520. type
  521.   PHHFtsQuery = ^THHFtsQuery;
  522.   tagHH_FTS_QUERY = packed record
  523.     cbStruct: Integer;         // Sizeof structure in bytes.
  524.     fUniCodeStrings: BOOL;     // TRUE if all strings are unicode.
  525.     pszSearchQuery: LPCTSTR;   // String containing the search query.
  526.     iProximity: LONG;          // Word proximity.
  527.     fStemmedSearch: BOOL;      // TRUE for StemmedSearch only.
  528.     fTitleOnly: BOOL;          // TRUE for Title search only.
  529.     fExecute: BOOL;            // TRUE to initiate the search.
  530.     pszWindow: LPCTSTR;        // Window to display in
  531.   end;
  532.   {$EXTERNALSYM tagHH_FTS_QUERY}
  533.   HH_FTS_QUERY = tagHH_FTS_QUERY;
  534.   {$EXTERNALSYM HH_FTS_QUERY}
  535.   THHFtsQuery = tagHH_FTS_QUERY;
  536.   PHHWinType = ^THHWinType;
  537.   tagHH_WINTYPE = packed record
  538.     cbStruct: Integer;      // IN: size of this structure including all Information Types
  539.     fUniCodeStrings: BOOL;  // IN/OUT: TRUE if all strings are in UNICODE
  540.     pszType: LPCTSTR;       // IN/OUT: Name of a type of window
  541.     fsValidMembers: DWORD;  // IN: Bit flag of valid members (HHWIN_PARAM_)
  542.     fsWinProperties: DWORD; // IN/OUT: Properties/attributes of the window (HHWIN_)
  543.     pszCaption: LPCTSTR;    // IN/OUT: Window title
  544.     dwStyles: DWORD;        // IN/OUT: Window styles
  545.     dwExStyles: DWORD;      // IN/OUT: Extended Window styles
  546.     rcWindowPos: RECT;      // IN: Starting position, OUT: current position
  547.     nShowState: Integer;    // IN: show state (e.g., SW_SHOW)
  548.     hwndHelp: HWND;         // OUT: window handle
  549.     hwndCaller: HWND;       // OUT: who called this window
  550.     paInfoTypes: PHHInfoType; // IN: Pointer to an array of Information Types
  551.     { The following members are only valid if HHWIN_PROP_TRI_PANE is set }
  552.     hwndToolBar: HWND;      // OUT: toolbar window in tri-pane window
  553.     hwndNavigation: HWND;   // OUT: navigation window in tri-pane window
  554.     hwndHTML: HWND;         // OUT: window displaying HTML in tri-pane window
  555.     iNavWidth: Integer;     // IN/OUT: width of navigation window
  556.     rcHTML: RECT;           // OUT: HTML window coordinates
  557.     pszToc: LPCTSTR;        // IN: Location of the table of contents file
  558.     pszIndex: LPCTSTR;      // IN: Location of the index file
  559.     pszFile: LPCTSTR;       // IN: Default location of the html file
  560.     pszHome: LPCTSTR;       // IN/OUT: html file to display when Home button is clicked
  561.     fsToolBarFlags: DWORD;  // IN: flags controling the appearance of the toolbar
  562.     fNotExpanded: BOOL;     // IN: TRUE/FALSE to contract or expand, OUT: current state
  563.     curNavType: Integer;    // IN/OUT: UI to display in the navigational pane
  564.     tabpos: Integer;        // IN/OUT: HHWIN_NAVTAB_TOP, HHWIN_NAVTAB_LEFT, or HHWIN_NAVTAB_BOTTOM
  565.     idNotify: Integer;      // IN: ID to use for WM_NOTIFY messages
  566.     tabOrder: array[0..HH_MAX_TABS] of Byte; // IN/OUT: tab order: Contents, Index, Search, History, Favorites, Reserved 1-5, Custom tabs
  567.     cHistory: Integer;      // IN/OUT: number of history items to keep (default is 30)
  568.     pszJump1: LPCTSTR;      // Text for HHWIN_BUTTON_JUMP1
  569.     pszJump2: LPCTSTR;      // Text for HHWIN_BUTTON_JUMP2
  570.     pszUrlJump1: LPCTSTR;   // URL for HHWIN_BUTTON_JUMP1
  571.     pszUrlJump2: LPCTSTR;   // URL for HHWIN_BUTTON_JUMP2
  572.     rcMinSize: RECT;        // Minimum size for window (ignored in version 1)
  573.     cbInfoTypes: Integer;   // size of paInfoTypes;
  574. {$IFDEF HTMLHELP12}
  575.     pszCustomTabs: LPCTSTR; // multiple zero-terminated Strings
  576. {$ENDIF}
  577.   end;
  578.   {$EXTERNALSYM tagHH_WINTYPE}
  579.   HH_WINTYPE = tagHH_WINTYPE;
  580.   {$EXTERNALSYM HH_WINTYPE}
  581.   PHH_WINTYPE = ^tagHH_WINTYPE;
  582.   {$EXTERNALSYM PHH_WINTYPE}
  583.   THHWinType = tagHH_WINTYPE;
  584. const
  585.   HHACT_TAB_CONTENTS  = 0;
  586.   {$EXTERNALSYM HHACT_TAB_CONTENTS}
  587.   HHACT_TAB_INDEX     = 1;
  588.   {$EXTERNALSYM HHACT_TAB_INDEX}
  589.   HHACT_TAB_SEARCH    = 2;
  590.   {$EXTERNALSYM HHACT_TAB_SEARCH}
  591.   HHACT_TAB_HISTORY   = 3;
  592.   {$EXTERNALSYM HHACT_TAB_HISTORY}
  593.   HHACT_TAB_FAVORITES = 4;
  594.   {$EXTERNALSYM HHACT_TAB_FAVORITES}
  595.   HHACT_EXPAND        = 5;
  596.   {$EXTERNALSYM HHACT_EXPAND}
  597.   HHACT_CONTRACT      = 6;
  598.   {$EXTERNALSYM HHACT_CONTRACT}
  599.   HHACT_BACK          = 7;
  600.   {$EXTERNALSYM HHACT_BACK}
  601.   HHACT_FORWARD       = 8;
  602.   {$EXTERNALSYM HHACT_FORWARD}
  603.   HHACT_STOP          = 9;
  604.   {$EXTERNALSYM HHACT_STOP}
  605.   HHACT_REFRESH       = 10;
  606.   {$EXTERNALSYM HHACT_REFRESH}
  607.   HHACT_HOME          = 11;
  608.   {$EXTERNALSYM HHACT_HOME}
  609.   HHACT_SYNC          = 12;
  610.   {$EXTERNALSYM HHACT_SYNC}
  611.   HHACT_OPTIONS       = 13;
  612.   {$EXTERNALSYM HHACT_OPTIONS}
  613.   HHACT_PRINT         = 14;
  614.   {$EXTERNALSYM HHACT_PRINT}
  615.   HHACT_HIGHLIGHT     = 15;
  616.   {$EXTERNALSYM HHACT_HIGHLIGHT}
  617.   HHACT_CUSTOMIZE     = 16;
  618.   {$EXTERNALSYM HHACT_CUSTOMIZE}
  619.   HHACT_JUMP1         = 17;
  620.   {$EXTERNALSYM HHACT_JUMP1}
  621.   HHACT_JUMP2         = 18;
  622.   {$EXTERNALSYM HHACT_JUMP2}
  623.   HHACT_ZOOM          = 19;
  624.   {$EXTERNALSYM HHACT_ZOOM}
  625.   HHACT_TOC_NEXT      = 20;
  626.   {$EXTERNALSYM HHACT_TOC_NEXT}
  627.   HHACT_TOC_PREV      = 21;
  628.   {$EXTERNALSYM HHACT_TOC_PREV}
  629.   HHACT_NOTES         = 22;
  630.   {$EXTERNALSYM HHACT_NOTES}
  631.   HHACT_LAST_ENUM     = 23;
  632.   {$EXTERNALSYM HHACT_LAST_ENUM}
  633. type
  634.   PHHNTrack = ^THHNTrack;
  635.   tagHHNTRACK = packed record
  636.     hdr: NMHDR;
  637.     pszCurUrl: PCSTR;        // Multi-byte, null-terminated string
  638.     idAction: Integer;       // HHACT_ value
  639.     phhWinType: PHHWinType;  // Current window type structure
  640.   end;
  641.   {$EXTERNALSYM tagHHNTRACK}
  642.   HHNTRACK = tagHHNTRACK;
  643.   {$EXTERNALSYM HHNTRACK}
  644.   THHNTrack = tagHHNTRACK;
  645. function HtmlHelpA(hwndCaller: HWND; pszFile: LPCSTR; uCommand: UINT; dwData: DWORD_PTR): HWND; stdcall;
  646. {$EXTERNALSYM HtmlHelpA}
  647. function HtmlHelpW(hwndCaller: HWND; pszFile: LPCWSTR; uCommand: UINT; dwData: DWORD_PTR): HWND; stdcall;
  648. {$EXTERNALSYM HtmlHelpW}
  649. {$IFDEF UNICODE}
  650. function HtmlHelp(hwndCaller: HWND; pszFile: LPCSTR; uCommand: UINT; dwData: DWORD_PTR): HWND; stdcall;
  651. {$ELSE}
  652. function HtmlHelp(hwndCaller: HWND; pszFile: LPCWSTR; uCommand: UINT; dwData: DWORD_PTR): HWND; stdcall;
  653. {$ENDIF}
  654. // Use the following for GetProcAddress to load from hhctrl.ocx
  655. const
  656.   ATOM_HTMLHELP_API_ANSI    = LPTSTR(DWORD(WORD(14)));
  657.   {$EXTERNALSYM ATOM_HTMLHELP_API_ANSI}
  658.   ATOM_HTMLHELP_API_UNICODE = LPTSTR(DWORD(WORD(15)));
  659.   {$EXTERNALSYM ATOM_HTMLHELP_API_UNICODE}
  660. {$IFDEF HTMLHELP12}
  661. // Global Control Properties
  662. const
  663.   HH_GPROPID_SINGLETHREAD     = 1; // VARIANT_BOOL: True for single thread
  664.   {$EXTERNALSYM HH_GPROPID_SINGLETHREAD}
  665.   HH_GPROPID_TOOLBAR_MARGIN   = 2; // long: Provides a left/right margin around the toolbar.
  666.   {$EXTERNALSYM HH_GPROPID_TOOLBAR_MARGIN}
  667.   HH_GPROPID_UI_LANGUAGE      = 3; // long: LangId of the UI.
  668.   {$EXTERNALSYM HH_GPROPID_UI_LANGUAGE}
  669.   HH_GPROPID_CURRENT_SUBSET   = 4; // BSTR: Current subset.
  670.   {$EXTERNALSYM HH_GPROPID_CURRENT_SUBSET}
  671.   HH_GPROPID_CONTENT_LANGUAGE = 5; // long: LandId for desired content.
  672.   {$EXTERNALSYM HH_GPROPID_CONTENT_LANGUAGE}
  673. type
  674.   HH_GPROPID = HH_GPROPID_SINGLETHREAD..HH_GPROPID_CONTENT_LANGUAGE;
  675.   {$EXTERNALSYM HH_GPROPID}
  676.   THHGPropID = HH_GPROPID;
  677. // Global Property structure
  678.   PHHGlobalProperty = ^THHGlobalProperty;
  679.   tagHH_GLOBAL_PROPERTY = record
  680.     id: THHGPropID;
  681.     Dummy: Integer;                        // MVB: Added to enforce 8-byte packing
  682.     var_: OleVariant;
  683.   end;
  684.   HH_GLOBAL_PROPERTY = tagHH_GLOBAL_PROPERTY;
  685.   THHGlobalProperty = tagHH_GLOBAL_PROPERTY;
  686. {$ENDIF}
  687. implementation
  688. {$IFDEF DYNAMIC_LINK}
  689. uses
  690.   JwaWinBase, JwaWinError, JwaWinNT, JwaWinReg;
  691. function GetOCXPath: string;
  692. const
  693.   HHPathRegKey = 'CLSID{adb880a6-d8ff-11cf-9377-00aa003b7a11}InprocServer32';
  694. var
  695.   HHKey: HKEY;
  696.   R, PathSize, ValueType: DWORD;
  697.   Path: string;
  698. begin
  699.   R := ERROR_PATH_NOT_FOUND;
  700.   if RegOpenKeyExA(HKEY_CLASSES_ROOT, PChar(HHPathRegKey), 0, KEY_QUERY_VALUE, HHKey) = ERROR_SUCCESS then
  701.   begin
  702.     ValueType := 0;
  703.     PathSize := 0;
  704.     if RegQueryValueExA(HHKey, PChar(''), nil, @ValueType, nil, @PathSize) = ERROR_SUCCESS then
  705.     begin
  706.       if ValueType = REG_SZ then
  707.       begin
  708.         SetLength(Path, PathSize);
  709.         R := RegQueryValueExA(HHKey, PChar(''), nil, @ValueType, PByte(Path), @PathSize);
  710.         Result := PChar(Path);
  711.       end;
  712.     end;
  713.     RegCloseKey(HHKey);
  714.   end;
  715.   if R <> ERROR_SUCCESS then Result := 'hhctrl.ocx';
  716. end;
  717. var
  718.   _HtmlHelpA: Pointer;
  719.   _HtmlHelpW: Pointer;
  720.   _HtmlHelp: Pointer;
  721. function HtmlHelpA;
  722. begin
  723.   GetProcedureAddress(_HtmlHelpA, GetOCXPath, 'HtmlHelpA');
  724.   asm
  725.     mov esp, ebp
  726.     pop ebp
  727.     jmp [_HtmlHelpA]
  728.   end;
  729. end;
  730. function HtmlHelpW;
  731. begin
  732.   GetProcedureAddress(_HtmlHelpA, GetOCXPath, 'HtmlHelpW');
  733.   asm
  734.     mov esp, ebp
  735.     pop ebp
  736.     jmp [_HtmlHelpW]
  737.   end;
  738. end;
  739. function HtmlHelp;
  740. begin
  741.   GetProcedureAddress(_HtmlHelp, GetOCXPath, {$IFDEF UNICODE}'HtmlHelpW'{$ELSE}'HtmlHelpA'{$ENDIF});
  742.   asm
  743.     mov esp, ebp
  744.     pop ebp
  745.     jmp [_HtmlHelp]
  746.   end;
  747. end;
  748. {$ELSE}
  749. const
  750.   hhctrl = 'hhctrl.ocx';
  751. function HtmlHelpA; external hhctrl name 'HtmlHelpA';
  752. function HtmlHelpW; external hhctrl name 'HtmlHelpW';
  753. function HtmlHelp; external hhctrl name {$IFDEF UNICODE}'HtmlHelpW'{$ELSE}'HtmlHelpA'{$ENDIF};
  754. {$ENDIF DYNAMIC_LINK}
  755. end.