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