Leaked source code of windows server 2003
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.

373 lines
16 KiB

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