Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

436 lines
18 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 1999
  6. //
  7. // File: htmlhelp.h
  8. //
  9. //--------------------------------------------------------------------------
  10. /****************************************************************************
  11. * *
  12. * HtmlHelp.h *
  13. * *
  14. * Copyright (c) 1996-1997, Microsoft Corp. All rights reserved. *
  15. * *
  16. ****************************************************************************/
  17. #if _MSC_VER > 1000
  18. #pragma once
  19. #endif
  20. #ifndef __HTMLHELP_H__
  21. #define __HTMLHELP_H__
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif // __cplusplus
  25. // Defines for Win64
  26. #ifndef _WIN64
  27. #define DWORD_PTR DWORD
  28. #endif
  29. // Commands to pass to HtmlHelp()
  30. #define HH_DISPLAY_TOPIC 0x0000
  31. #define HH_HELP_FINDER 0x0000 // WinHelp equivalent
  32. #define HH_DISPLAY_TOC 0x0001 // not currently implemented
  33. #define HH_DISPLAY_INDEX 0x0002 // not currently implemented
  34. #define HH_DISPLAY_SEARCH 0x0003 // not currently implemented
  35. #define HH_SET_WIN_TYPE 0x0004
  36. #define HH_GET_WIN_TYPE 0x0005
  37. #define HH_GET_WIN_HANDLE 0x0006
  38. #define HH_ENUM_INFO_TYPE 0x0007 // Get Info type name, call repeatedly to enumerate, -1 at end
  39. #define HH_SET_INFO_TYPE 0x0008 // Add Info type to filter.
  40. #define HH_SYNC 0x0009
  41. #define HH_RESERVED1 0x000A
  42. #define HH_RESERVED2 0x000B
  43. #define HH_RESERVED3 0x000C
  44. #define HH_KEYWORD_LOOKUP 0x000D
  45. #define HH_DISPLAY_TEXT_POPUP 0x000E // display string resource id or text in a popup window
  46. #define HH_HELP_CONTEXT 0x000F // display mapped numeric value in dwData
  47. #define HH_TP_HELP_CONTEXTMENU 0x0010 // text popup help, same as WinHelp HELP_CONTEXTMENU
  48. #define HH_TP_HELP_WM_HELP 0x0011 // text popup help, same as WinHelp HELP_WM_HELP
  49. #define HH_CLOSE_ALL 0x0012 // close all windows opened directly or indirectly by the caller
  50. #define HH_ALINK_LOOKUP 0x0013 // ALink version of HH_KEYWORD_LOOKUP
  51. #define HH_GET_LAST_ERROR 0x0014 // not currently implemented // See HHERROR.h
  52. #define HH_ENUM_CATEGORY 0x0015 // Get category name, call repeatedly to enumerate, -1 at end
  53. #define HH_ENUM_CATEGORY_IT 0x0016 // Get category info type members, call repeatedly to enumerate, -1 at end
  54. #define HH_RESET_IT_FILTER 0x0017 // Clear the info type filter of all info types.
  55. #define HH_SET_INCLUSIVE_FILTER 0x0018 // set inclusive filtering method for untyped topics to be included in display
  56. #define HH_SET_EXCLUSIVE_FILTER 0x0019 // set exclusive filtering method for untyped topics to be excluded from display
  57. #define HH_INITIALIZE 0x001C // Initializes the help system.
  58. #define HH_UNINITIALIZE 0x001D // Uninitializes the help system.
  59. #define HH_PRETRANSLATEMESSAGE 0x00fd // Pumps messages. (NULL, NULL, MSG*).
  60. #define HH_SET_GLOBAL_PROPERTY 0x00fc // Set a global property. (NULL, NULL, HH_GPROP)
  61. #define HHWIN_PROP_TAB_AUTOHIDESHOW (1 << 0) // Automatically hide/show tri-pane window
  62. #define HHWIN_PROP_ONTOP (1 << 1) // Top-most window
  63. #define HHWIN_PROP_NOTITLEBAR (1 << 2) // no title bar
  64. #define HHWIN_PROP_NODEF_STYLES (1 << 3) // no default window styles (only HH_WINTYPE.dwStyles)
  65. #define HHWIN_PROP_NODEF_EXSTYLES (1 << 4) // no default extended window styles (only HH_WINTYPE.dwExStyles)
  66. #define HHWIN_PROP_TRI_PANE (1 << 5) // use a tri-pane window
  67. #define HHWIN_PROP_NOTB_TEXT (1 << 6) // no text on toolbar buttons
  68. #define HHWIN_PROP_POST_QUIT (1 << 7) // post WM_QUIT message when window closes
  69. #define HHWIN_PROP_AUTO_SYNC (1 << 8) // automatically ssync contents and index
  70. #define HHWIN_PROP_TRACKING (1 << 9) // send tracking notification messages
  71. #define HHWIN_PROP_TAB_SEARCH (1 << 10) // include search tab in navigation pane
  72. #define HHWIN_PROP_TAB_HISTORY (1 << 11) // include history tab in navigation pane
  73. #define HHWIN_PROP_TAB_FAVORITES (1 << 12) // include favorites tab in navigation pane
  74. #define HHWIN_PROP_CHANGE_TITLE (1 << 13) // Put current HTML title in title bar
  75. #define HHWIN_PROP_NAV_ONLY_WIN (1 << 14) // Only display the navigation window
  76. #define HHWIN_PROP_NO_TOOLBAR (1 << 15) // Don't display a toolbar
  77. #define HHWIN_PROP_MENU (1 << 16) // Menu
  78. #define HHWIN_PROP_TAB_ADVSEARCH (1 << 17) // Advanced FTS UI.
  79. #define HHWIN_PROP_USER_POS (1 << 18) // After initial creation, user controls window size/position
  80. #define HHWIN_PROP_TAB_CUSTOM1 (1 << 19) // Use custom tab #1
  81. #define HHWIN_PROP_TAB_CUSTOM2 (1 << 20) // Use custom tab #2
  82. #define HHWIN_PROP_TAB_CUSTOM3 (1 << 21) // Use custom tab #3
  83. #define HHWIN_PROP_TAB_CUSTOM4 (1 << 22) // Use custom tab #4
  84. #define HHWIN_PROP_TAB_CUSTOM5 (1 << 23) // Use custom tab #5
  85. #define HHWIN_PROP_TAB_CUSTOM6 (1 << 24) // Use custom tab #6
  86. #define HHWIN_PROP_TAB_CUSTOM7 (1 << 25) // Use custom tab #7
  87. #define HHWIN_PROP_TAB_CUSTOM8 (1 << 26) // Use custom tab #8
  88. #define HHWIN_PROP_TAB_CUSTOM9 (1 << 27) // Use custom tab #9
  89. #define HHWIN_TB_MARGIN (1 << 28) // the window type has a margin
  90. #define HHWIN_PARAM_PROPERTIES (1 << 1) // valid fsWinProperties
  91. #define HHWIN_PARAM_STYLES (1 << 2) // valid dwStyles
  92. #define HHWIN_PARAM_EXSTYLES (1 << 3) // valid dwExStyles
  93. #define HHWIN_PARAM_RECT (1 << 4) // valid rcWindowPos
  94. #define HHWIN_PARAM_NAV_WIDTH (1 << 5) // valid iNavWidth
  95. #define HHWIN_PARAM_SHOWSTATE (1 << 6) // valid nShowState
  96. #define HHWIN_PARAM_INFOTYPES (1 << 7) // valid apInfoTypes
  97. #define HHWIN_PARAM_TB_FLAGS (1 << 8) // valid fsToolBarFlags
  98. #define HHWIN_PARAM_EXPANSION (1 << 9) // valid fNotExpanded
  99. #define HHWIN_PARAM_TABPOS (1 << 10) // valid tabpos
  100. #define HHWIN_PARAM_TABORDER (1 << 11) // valid taborder
  101. #define HHWIN_PARAM_HISTORY_COUNT (1 << 12) // valid cHistory
  102. #define HHWIN_PARAM_CUR_TAB (1 << 13) // valid curNavType
  103. #define HHWIN_BUTTON_EXPAND (1 << 1) // Expand/contract button
  104. #define HHWIN_BUTTON_BACK (1 << 2) // Back button
  105. #define HHWIN_BUTTON_FORWARD (1 << 3) // Forward button
  106. #define HHWIN_BUTTON_STOP (1 << 4) // Stop button
  107. #define HHWIN_BUTTON_REFRESH (1 << 5) // Refresh button
  108. #define HHWIN_BUTTON_HOME (1 << 6) // Home button
  109. #define HHWIN_BUTTON_BROWSE_FWD (1 << 7) // not implemented
  110. #define HHWIN_BUTTON_BROWSE_BCK (1 << 8) // not implemented
  111. #define HHWIN_BUTTON_NOTES (1 << 9) // not implemented
  112. #define HHWIN_BUTTON_CONTENTS (1 << 10) // not implemented
  113. #define HHWIN_BUTTON_SYNC (1 << 11) // Sync button
  114. #define HHWIN_BUTTON_OPTIONS (1 << 12) // Options button
  115. #define HHWIN_BUTTON_PRINT (1 << 13) // Print button
  116. #define HHWIN_BUTTON_INDEX (1 << 14) // not implemented
  117. #define HHWIN_BUTTON_SEARCH (1 << 15) // not implemented
  118. #define HHWIN_BUTTON_HISTORY (1 << 16) // not implemented
  119. #define HHWIN_BUTTON_FAVORITES (1 << 17) // not implemented
  120. #define HHWIN_BUTTON_JUMP1 (1 << 18)
  121. #define HHWIN_BUTTON_JUMP2 (1 << 19)
  122. #define HHWIN_BUTTON_ZOOM (1 << 20)
  123. #define HHWIN_BUTTON_TOC_NEXT (1 << 21)
  124. #define HHWIN_BUTTON_TOC_PREV (1 << 22)
  125. #define HHWIN_DEF_BUTTONS \
  126. (HHWIN_BUTTON_EXPAND | \
  127. HHWIN_BUTTON_BACK | \
  128. HHWIN_BUTTON_OPTIONS | \
  129. HHWIN_BUTTON_PRINT)
  130. // Button IDs
  131. #define IDTB_EXPAND 200
  132. #define IDTB_CONTRACT 201
  133. #define IDTB_STOP 202
  134. #define IDTB_REFRESH 203
  135. #define IDTB_BACK 204
  136. #define IDTB_HOME 205
  137. #define IDTB_SYNC 206
  138. #define IDTB_PRINT 207
  139. #define IDTB_OPTIONS 208
  140. #define IDTB_FORWARD 209
  141. #define IDTB_NOTES 210 // not implemented
  142. #define IDTB_BROWSE_FWD 211
  143. #define IDTB_BROWSE_BACK 212
  144. #define IDTB_CONTENTS 213 // not implemented
  145. #define IDTB_INDEX 214 // not implemented
  146. #define IDTB_SEARCH 215 // not implemented
  147. #define IDTB_HISTORY 216 // not implemented
  148. #define IDTB_FAVORITES 217 // not implemented
  149. #define IDTB_JUMP1 218
  150. #define IDTB_JUMP2 219
  151. #define IDTB_CUSTOMIZE 221
  152. #define IDTB_ZOOM 222
  153. #define IDTB_TOC_NEXT 223
  154. #define IDTB_TOC_PREV 224
  155. // Notification codes
  156. #define HHN_FIRST (0U-860U)
  157. #define HHN_LAST (0U-879U)
  158. #define HHN_NAVCOMPLETE (HHN_FIRST-0)
  159. #define HHN_TRACK (HHN_FIRST-1)
  160. #define HHN_WINDOW_CREATE (HHN_FIRST-2)
  161. typedef struct tagHHN_NOTIFY
  162. {
  163. NMHDR hdr;
  164. PCSTR pszUrl; // Multi-byte, null-terminated string
  165. } HHN_NOTIFY;
  166. typedef struct tagHH_POPUP
  167. {
  168. int cbStruct; // sizeof this structure
  169. HINSTANCE hinst; // instance handle for string resource
  170. UINT idString; // string resource id, or text id if pszFile is specified in HtmlHelp call
  171. LPCTSTR pszText; // used if idString is zero
  172. POINT pt; // top center of popup window
  173. COLORREF clrForeground; // use -1 for default
  174. COLORREF clrBackground; // use -1 for default
  175. RECT rcMargins; // amount of space between edges of window and text, -1 for each member to ignore
  176. LPCTSTR pszFont; // facename, point size, char set, BOLD ITALIC UNDERLINE
  177. } HH_POPUP;
  178. typedef struct tagHH_AKLINK
  179. {
  180. int cbStruct; // sizeof this structure
  181. BOOL fReserved; // must be FALSE (really!)
  182. LPCTSTR pszKeywords; // semi-colon separated keywords
  183. LPCTSTR pszUrl; // URL to jump to if no keywords found (may be NULL)
  184. LPCTSTR pszMsgText; // Message text to display in MessageBox if pszUrl is NULL and no keyword match
  185. LPCTSTR pszMsgTitle; // Message text to display in MessageBox if pszUrl is NULL and no keyword match
  186. LPCTSTR pszWindow; // Window to display URL in
  187. BOOL fIndexOnFail; // Displays index if keyword lookup fails.
  188. } HH_AKLINK;
  189. enum {
  190. HHWIN_NAVTYPE_TOC,
  191. HHWIN_NAVTYPE_INDEX,
  192. HHWIN_NAVTYPE_SEARCH,
  193. HHWIN_NAVTYPE_FAVORITES,
  194. HHWIN_NAVTYPE_HISTORY, // not implemented
  195. HHWIN_NAVTYPE_AUTHOR,
  196. HHWIN_NAVTYPE_CUSTOM_FIRST = 11
  197. };
  198. enum {
  199. IT_INCLUSIVE,
  200. IT_EXCLUSIVE,
  201. IT_HIDDEN,
  202. };
  203. typedef struct tagHH_ENUM_IT
  204. {
  205. int cbStruct; // size of this structure
  206. int iType; // the type of the information type ie. Inclusive, Exclusive, or Hidden
  207. LPCSTR pszCatName; // Set to the name of the Category to enumerate the info types in a category; else NULL
  208. LPCSTR pszITName; // volitile pointer to the name of the infotype. Allocated by call. Caller responsible for freeing
  209. LPCSTR pszITDescription; // volitile pointer to the description of the infotype.
  210. } HH_ENUM_IT, *PHH_ENUM_IT;
  211. typedef struct tagHH_ENUM_CAT
  212. {
  213. int cbStruct; // size of this structure
  214. LPCSTR pszCatName; // volitile pointer to the category name
  215. LPCSTR pszCatDescription; // volitile pointer to the category description
  216. } HH_ENUM_CAT, *PHH_ENUM_CAT;
  217. typedef struct tagHH_SET_INFOTYPE
  218. {
  219. int cbStruct; // the size of this structure
  220. LPCSTR pszCatName; // the name of the category, if any, the InfoType is a member of.
  221. LPCSTR pszInfoTypeName; // the name of the info type to add to the filter
  222. } HH_SET_INFOTYPE, *PHH_SET_INFOTYPE;
  223. typedef DWORD HH_INFOTYPE;
  224. typedef HH_INFOTYPE* PHH_INFOTYPE;
  225. enum {
  226. HHWIN_NAVTAB_TOP,
  227. HHWIN_NAVTAB_LEFT,
  228. HHWIN_NAVTAB_BOTTOM,
  229. };
  230. #define HH_MAX_TABS 19 // maximum number of tabs
  231. enum {
  232. HH_TAB_CONTENTS,
  233. HH_TAB_INDEX,
  234. HH_TAB_SEARCH,
  235. HH_TAB_FAVORITES,
  236. HH_TAB_HISTORY,
  237. HH_TAB_AUTHOR,
  238. HH_TAB_CUSTOM_FIRST = 11,
  239. HH_TAB_CUSTOM_LAST = HH_MAX_TABS
  240. };
  241. #define HH_MAX_TABS_CUSTOM (HH_TAB_CUSTOM_LAST - HH_TAB_CUSTOM_FIRST + 1)
  242. // HH_DISPLAY_SEARCH Command Related Structures and Constants
  243. #define HH_FTS_DEFAULT_PROXIMITY (-1)
  244. typedef struct tagHH_FTS_QUERY
  245. {
  246. int cbStruct; // Sizeof structure in bytes.
  247. BOOL fUniCodeStrings; // TRUE if all strings are unicode.
  248. LPCTSTR pszSearchQuery; // String containing the search query.
  249. LONG iProximity; // Word proximity.
  250. BOOL fStemmedSearch; // TRUE for StemmedSearch only.
  251. BOOL fTitleOnly; // TRUE for Title search only.
  252. BOOL fExecute; // TRUE to initiate the search.
  253. LPCTSTR pszWindow; // Window to display in
  254. } HH_FTS_QUERY;
  255. // HH_WINTYPE Structure
  256. typedef struct tagHH_WINTYPE {
  257. int cbStruct; // IN: size of this structure including all Information Types
  258. BOOL fUniCodeStrings; // IN/OUT: TRUE if all strings are in UNICODE
  259. LPCTSTR pszType; // IN/OUT: Name of a type of window
  260. DWORD fsValidMembers; // IN: Bit flag of valid members (HHWIN_PARAM_)
  261. DWORD fsWinProperties; // IN/OUT: Properties/attributes of the window (HHWIN_)
  262. LPCTSTR pszCaption; // IN/OUT: Window title
  263. DWORD dwStyles; // IN/OUT: Window styles
  264. DWORD dwExStyles; // IN/OUT: Extended Window styles
  265. RECT rcWindowPos; // IN: Starting position, OUT: current position
  266. int nShowState; // IN: show state (e.g., SW_SHOW)
  267. HWND hwndHelp; // OUT: window handle
  268. HWND hwndCaller; // OUT: who called this window
  269. HH_INFOTYPE* paInfoTypes; // IN: Pointer to an array of Information Types
  270. // The following members are only valid if HHWIN_PROP_TRI_PANE is set
  271. HWND hwndToolBar; // OUT: toolbar window in tri-pane window
  272. HWND hwndNavigation; // OUT: navigation window in tri-pane window
  273. HWND hwndHTML; // OUT: window displaying HTML in tri-pane window
  274. int iNavWidth; // IN/OUT: width of navigation window
  275. RECT rcHTML; // OUT: HTML window coordinates
  276. LPCTSTR pszToc; // IN: Location of the table of contents file
  277. LPCTSTR pszIndex; // IN: Location of the index file
  278. LPCTSTR pszFile; // IN: Default location of the html file
  279. LPCTSTR pszHome; // IN/OUT: html file to display when Home button is clicked
  280. DWORD fsToolBarFlags; // IN: flags controling the appearance of the toolbar
  281. BOOL fNotExpanded; // IN: TRUE/FALSE to contract or expand, OUT: current state
  282. int curNavType; // IN/OUT: UI to display in the navigational pane
  283. int tabpos; // IN/OUT: HHWIN_NAVTAB_TOP, HHWIN_NAVTAB_LEFT, or HHWIN_NAVTAB_BOTTOM
  284. int idNotify; // IN: ID to use for WM_NOTIFY messages
  285. BYTE tabOrder[HH_MAX_TABS + 1]; // IN/OUT: tab order: Contents, Index, Search, History, Favorites, Reserved 1-5, Custom tabs
  286. int cHistory; // IN/OUT: number of history items to keep (default is 30)
  287. LPCTSTR pszJump1; // Text for HHWIN_BUTTON_JUMP1
  288. LPCTSTR pszJump2; // Text for HHWIN_BUTTON_JUMP2
  289. LPCTSTR pszUrlJump1; // URL for HHWIN_BUTTON_JUMP1
  290. LPCTSTR pszUrlJump2; // URL for HHWIN_BUTTON_JUMP2
  291. RECT rcMinSize; // Minimum size for window (ignored in version 1)
  292. int cbInfoTypes; // size of paInfoTypes;
  293. LPCTSTR pszCustomTabs; // multiple zero-terminated strings
  294. } HH_WINTYPE, *PHH_WINTYPE;
  295. enum {
  296. HHACT_TAB_CONTENTS,
  297. HHACT_TAB_INDEX,
  298. HHACT_TAB_SEARCH,
  299. HHACT_TAB_HISTORY,
  300. HHACT_TAB_FAVORITES,
  301. HHACT_EXPAND,
  302. HHACT_CONTRACT,
  303. HHACT_BACK,
  304. HHACT_FORWARD,
  305. HHACT_STOP,
  306. HHACT_REFRESH,
  307. HHACT_HOME,
  308. HHACT_SYNC,
  309. HHACT_OPTIONS,
  310. HHACT_PRINT,
  311. HHACT_HIGHLIGHT,
  312. HHACT_CUSTOMIZE,
  313. HHACT_JUMP1,
  314. HHACT_JUMP2,
  315. HHACT_ZOOM,
  316. HHACT_TOC_NEXT,
  317. HHACT_TOC_PREV,
  318. HHACT_NOTES,
  319. HHACT_LAST_ENUM,
  320. };
  321. typedef struct tagHHNTRACK
  322. {
  323. NMHDR hdr;
  324. PCSTR pszCurUrl; // Multi-byte, null-terminated string
  325. int idAction; // HHACT_ value
  326. HH_WINTYPE* phhWinType; // Current window type structure
  327. } HHNTRACK;
  328. HWND
  329. WINAPI
  330. HtmlHelpA(
  331. HWND hwndCaller,
  332. LPCSTR pszFile,
  333. UINT uCommand,
  334. DWORD_PTR dwData
  335. );
  336. HWND
  337. WINAPI
  338. HtmlHelpW(
  339. HWND hwndCaller,
  340. LPCWSTR pszFile,
  341. UINT uCommand,
  342. DWORD_PTR dwData
  343. );
  344. #ifdef UNICODE
  345. #define HtmlHelp HtmlHelpW
  346. #else
  347. #define HtmlHelp HtmlHelpA
  348. #endif // !UNICODE
  349. // Use the following for GetProcAddress to load from hhctrl.ocx
  350. #define ATOM_HTMLHELP_API_ANSI (LPTSTR)((DWORD)((WORD)(14)))
  351. #define ATOM_HTMLHELP_API_UNICODE (LPTSTR)((DWORD)((WORD)(15)))
  352. ///////////////////////////////////////////////////////////////////////////////
  353. //
  354. // Global Control Properties.
  355. //
  356. typedef enum tagHH_GPROPID
  357. {
  358. HH_GPROPID_SINGLETHREAD=1, // VARIANT_BOOL: True for single thread
  359. HH_GPROPID_TOOLBAR_MARGIN=2, // long: Provides a left/right margin around the toolbar.
  360. HH_GPROPID_UI_LANGUAGE=3, // long: LangId of the UI.
  361. HH_GPROPID_CURRENT_SUBSET=4, // BSTR: Current subset.
  362. HH_GPROPID_CONTENT_LANGUAGE=5 // long: LandId for desired content.
  363. } HH_GPROPID;
  364. ///////////////////////////////////////////////////////////////////////////////
  365. //
  366. // Global Property structure
  367. //
  368. #ifdef __oaidl_h__
  369. #pragma pack(push, 8)
  370. typedef struct tagHH_GLOBAL_PROPERTY
  371. {
  372. HH_GPROPID id;
  373. VARIANT var;
  374. } HH_GLOBAL_PROPERTY ;
  375. #pragma pack(pop)
  376. #endif
  377. #ifdef __cplusplus
  378. }
  379. #endif // __cplusplus
  380. #endif // __HTMLHELP_H__