' ########################################################################################
' Microsoft Windows
' File: HtmlHelp.inc
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_HtmlHelp_PBI)
#DEFINE PBX_HtmlHelp_PBI
%EQUATE `HTMLHELP_INC = 1
#INCLUDE ONCE "Core/Windows.inc"
#INCLUDE ONCE "Legacy/COM/OAIdl.inc" ' For tagVARIANT
'// Commands to pass to HtmlHelp()
%EQUATE `HH_DISPLAY_TOPIC = &H0000
%EQUATE `HH_HELP_FINDER = &H0000 ' WinHelp equivalent
%EQUATE `HH_DISPLAY_TOC = &H0001
%EQUATE `HH_DISPLAY_INDEX = &H0002
%EQUATE `HH_DISPLAY_SEARCH = &H0003
%EQUATE `HH_SET_WIN_TYPE = &H0004
%EQUATE `HH_GET_WIN_TYPE = &H0005
%EQUATE `HH_GET_WIN_HANDLE = &H0006
%EQUATE `HH_ENUM_INFO_TYPE = &H0007 ' Get Info type name, call repeatedly to enumerate, -1 at end
%EQUATE `HH_SET_INFO_TYPE = &H0008 ' Add Info type to filter.
%EQUATE `HH_SYNC = &H0009
%EQUATE `HH_RESERVED1 = &H000A
%EQUATE `HH_RESERVED2 = &H000B
%EQUATE `HH_RESERVED3 = &H000C
%EQUATE `HH_KEYWORD_LOOKUP = &H000D
%EQUATE `HH_DISPLAY_TEXT_POPUP = &H000E ' display string resource id or text in a popup window
%EQUATE `HH_HELP_CONTEXT = &H000F ' display mapped numeric value in dwData
%EQUATE `HH_TP_HELP_CONTEXTMENU = &H0010 ' text popup help, same as WinHelp %HELP_CONTEXTMENU
%EQUATE `HH_TP_HELP_WM_HELP = &H0011 ' text popup help, same as WinHelp %HELP_WM_HELP
%EQUATE `HH_CLOSE_ALL = &H0012 ' close all windows opened directly or indirectly by the caller
%EQUATE `HH_ALINK_LOOKUP = &H0013 ' ALink version of %HH_KEYWORD_LOOKUP
%EQUATE `HH_GET_LAST_ERROR = &H0014 ' not currently implemented ' See HHERROR.h [*** PB note: the Windows SDK has no such file]
%EQUATE `HH_ENUM_CATEGORY = &H0015 ' Get category name, call repeatedly to enumerate, -1 at end
%EQUATE `HH_ENUM_CATEGORY_IT = &H0016 ' Get category info type members, call repeatedly to enumerate, -1 at end
%EQUATE `HH_RESET_IT_FILTER = &H0017 ' Clear the info type filter of all info types.
%EQUATE `HH_SET_INCLUSIVE_FILTER = &H0018 ' set inclusive filtering method for untyped topics to be included in display
%EQUATE `HH_SET_EXCLUSIVE_FILTER = &H0019 ' set exclusive filtering method for untyped topics to be excluded from display
%EQUATE `HH_INITIALIZE = &H001C ' Initializes the help system.
%EQUATE `HH_UNINITIALIZE = &H001D ' Uninitializes the help system.
%EQUATE `HH_SET_QUERYSERVICE = &H001E ' Set the Host IQueryService interface
%EQUATE `HH_PRETRANSLATEMESSAGE = &H00fd ' Pumps messages. (%NULL, %NULL, MSG PTR).
%EQUATE `HH_SET_GLOBAL_PROPERTY = &H00fc ' Set a global property. (%NULL, %NULL, HH_GPROP)
%EQUATE `HH_SAFE_DISPLAY_TOPIC = &H0020 ' private addition to the interface for InternetExplorer.
%EQUATE `HHWIN_PROP_TAB_AUTOHIDESHOW = &H00000001 ' (1 << 0) Automatically hide/show tri-pane window
%EQUATE `HHWIN_PROP_ONTOP = &H00000002 ' (1 << 1) Top-most window
%EQUATE `HHWIN_PROP_NOTITLEBAR = &H00000004 ' (1 << 2) no title bar
%EQUATE `HHWIN_PROP_NODEF_STYLES = &H00000008 ' (1 << 3) no default window styles (only HH_WINTYPE.dwStyles)
%EQUATE `HHWIN_PROP_NODEF_EXSTYLES = &H00000010 ' (1 << 4) no default extended window styles (only HH_WINTYPE.dwExStyles)
%EQUATE `HHWIN_PROP_TRI_PANE = &H00000020 ' (1 << 5) use a tri-pane window
%EQUATE `HHWIN_PROP_NOTB_TEXT = &H00000040 ' (1 << 6) no text on toolbar buttons
%EQUATE `HHWIN_PROP_POST_QUIT = &H00000080 ' (1 << 7) post WM_QUIT message when window closes
%EQUATE `HHWIN_PROP_AUTO_SYNC = &H00000100 ' (1 << 8) automatically ssync contents and index
%EQUATE `HHWIN_PROP_TRACKING = &H00000200 ' (1 << 9) send tracking notification messages
%EQUATE `HHWIN_PROP_TAB_SEARCH = &H00000400 ' (1 << 10) include search tab in navigation pane
%EQUATE `HHWIN_PROP_TAB_HISTORY = &H00000800 ' (1 << 11) include history tab in navigation pane
%EQUATE `HHWIN_PROP_TAB_FAVORITES = &H00001000 ' (1 << 12) include favorites tab in navigation pane
%EQUATE `HHWIN_PROP_CHANGE_TITLE = &H00002000 ' (1 << 13) Put current HTML title in title bar
%EQUATE `HHWIN_PROP_NAV_ONLY_WIN = &H00004000 ' (1 << 14) Only display the navigation window
%EQUATE `HHWIN_PROP_NO_TOOLBAR = &H00008000 ' (1 << 15) Don't display a toolbar
%EQUATE `HHWIN_PROP_MENU = &H00010000 ' (1 << 16) Menu
%EQUATE `HHWIN_PROP_TAB_ADVSEARCH = &H00020000 ' (1 << 17) Advanced FTS UI.
%EQUATE `HHWIN_PROP_USER_POS = &H00040000 ' (1 << 18)After initial creation, user controls window size/position
%EQUATE `HHWIN_PROP_TAB_CUSTOM1 = &H00080000 ' (1 << 19) Use custom tab #1
%EQUATE `HHWIN_PROP_TAB_CUSTOM2 = &H00100000 ' (1 << 20) Use custom tab #2
%EQUATE `HHWIN_PROP_TAB_CUSTOM3 = &H00200000 ' (1 << 21) Use custom tab #3
%EQUATE `HHWIN_PROP_TAB_CUSTOM4 = &H00400000 ' (1 << 22) Use custom tab #4
%EQUATE `HHWIN_PROP_TAB_CUSTOM5 = &H00800000 ' (1 << 23) Use custom tab #5
%EQUATE `HHWIN_PROP_TAB_CUSTOM6 = &H01000000 ' (1 << 24) Use custom tab #6
%EQUATE `HHWIN_PROP_TAB_CUSTOM7 = &H02000000 ' (1 << 25) Use custom tab #7
%EQUATE `HHWIN_PROP_TAB_CUSTOM8 = &H03000000 ' (1 << 26) Use custom tab #8
%EQUATE `HHWIN_PROP_TAB_CUSTOM9 = &H04000000 ' (1 << 27) Use custom tab #9
%EQUATE `HHWIN_TB_MARGIN = &H10000000 ' (1 << 28) the window type has a margin
%EQUATE `HHWIN_PARAM_PROPERTIES = &H00000002 ' (1 << 1) valid fsWinProperties
%EQUATE `HHWIN_PARAM_STYLES = &H00000004 ' (1 << 2) valid dwStyles
%EQUATE `HHWIN_PARAM_EXSTYLES = &H00000008 ' (1 << 3) valid dwExStyles
%EQUATE `HHWIN_PARAM_RECT = &H00000010 ' (1 << 4) valid rcWindowPos
%EQUATE `HHWIN_PARAM_NAV_WIDTH = &H00000020 ' (1 << 5) valid iNavWidth
%EQUATE `HHWIN_PARAM_SHOWSTATE = &H00000040 ' (1 << 6) valid nShowState
%EQUATE `HHWIN_PARAM_INFOTYPES = &H00000080 ' (1 << 7) valid apInfoTypes
%EQUATE `HHWIN_PARAM_TB_FLAGS = &H00000100 ' (1 << 8) valid fsToolBarFlags
%EQUATE `HHWIN_PARAM_EXPANSION = &H00000200 ' (1 << 9) valid fNotExpanded
%EQUATE `HHWIN_PARAM_TABPOS = &H00000400 ' (1 << 10) valid tabpos
%EQUATE `HHWIN_PARAM_TABORDER = &H00000800 ' (1 << 11) valid taborder
%EQUATE `HHWIN_PARAM_HISTORY_COUNT = &H00001000 ' (1 << 12) valid cHistory
%EQUATE `HHWIN_PARAM_CUR_TAB = &H00002000 ' (1 << 13) valid curNavType
%EQUATE `HHWIN_BUTTON_EXPAND = &H00000002 ' (1 << 1) Expand/contract button
%EQUATE `HHWIN_BUTTON_BACK = &H00000004 ' (1 << 2) Back button
%EQUATE `HHWIN_BUTTON_FORWARD = &H00000008 ' (1 << 3) Forward button
%EQUATE `HHWIN_BUTTON_STOP = &H00000010 ' (1 << 4) Stop button
%EQUATE `HHWIN_BUTTON_REFRESH = &H00000020 ' (1 << 5) Refresh button
%EQUATE `HHWIN_BUTTON_HOME = &H00000040 ' (1 << 6) Home button
%EQUATE `HHWIN_BUTTON_BROWSE_FWD = &H00000080 ' (1 << 7) not implemented
%EQUATE `HHWIN_BUTTON_BROWSE_BCK = &H00000100 ' (1 << 8) not implemented
%EQUATE `HHWIN_BUTTON_NOTES = &H00000200 ' (1 << 9) not implemented
%EQUATE `HHWIN_BUTTON_CONTENTS = &H00000400 ' (1 << 10) not implemented
%EQUATE `HHWIN_BUTTON_SYNC = &H00000800 ' (1 << 11) Sync button
%EQUATE `HHWIN_BUTTON_OPTIONS = &H00001000 ' (1 << 12) Options button
%EQUATE `HHWIN_BUTTON_PRINT = &H00002000 ' (1 << 13) Print button
%EQUATE `HHWIN_BUTTON_INDEX = &H00004000 ' (1 << 14) not implemented
%EQUATE `HHWIN_BUTTON_SEARCH = &H00008000 ' (1 << 15) not implemented
%EQUATE `HHWIN_BUTTON_HISTORY = &H00010000 ' (1 << 16) not implemented
%EQUATE `HHWIN_BUTTON_FAVORITES = &H00020000 ' (1 << 17) not implemented
%EQUATE `HHWIN_BUTTON_JUMP1 = &H00040000 ' (1 << 18)
%EQUATE `HHWIN_BUTTON_JUMP2 = &H00080000 ' (1 << 19)
%EQUATE `HHWIN_BUTTON_ZOOM = &H00100000 ' (1 << 20)
%EQUATE `HHWIN_BUTTON_TOC_NEXT = &H00200000 ' (1 << 21)
%EQUATE `HHWIN_BUTTON_TOC_PREV = &H00400000 ' (1 << 22)
%EQUATE `HHWIN_DEF_BUTTONS = %HHWIN_BUTTON_EXPAND OR %HHWIN_BUTTON_BACK OR %HHWIN_BUTTON_OPTIONS OR %HHWIN_BUTTON_PRINT
'// Button IDs
%EQUATE `IDTB_EXPAND = 200
%EQUATE `IDTB_CONTRACT = 201
%EQUATE `IDTB_STOP = 202
%EQUATE `IDTB_REFRESH = 203
%EQUATE `IDTB_BACK = 204
%EQUATE `IDTB_HOME = 205
%EQUATE `IDTB_SYNC = 206
%EQUATE `IDTB_PRINT = 207
%EQUATE `IDTB_OPTIONS = 208
%EQUATE `IDTB_FORWARD = 209
%EQUATE `IDTB_NOTES = 210 ' not implemented
%EQUATE `IDTB_BROWSE_FWD = 211
%EQUATE `IDTB_BROWSE_BACK = 212
%EQUATE `IDTB_CONTENTS = 213 ' not implemented
%EQUATE `IDTB_INDEX = 214 ' not implemented
%EQUATE `IDTB_SEARCH = 215 ' not implemented
%EQUATE `IDTB_HISTORY = 216 ' not implemented
%EQUATE `IDTB_FAVORITES = 217 ' not implemented
%EQUATE `IDTB_JUMP1 = 218
%EQUATE `IDTB_JUMP2 = 219
%EQUATE `IDTB_CUSTOMIZE = 221
%EQUATE `IDTB_ZOOM = 222
%EQUATE `IDTB_TOC_NEXT = 223
%EQUATE `IDTB_TOC_PREV = 224
'// Notification codes
%EQUATE `HHN_FIRST = -860
%EQUATE `HHN_LAST = -879
%EQUATE `HHN_NAVCOMPLETE = %HHN_FIRST
%EQUATE `HHN_TRACK = %HHN_FIRST - 1
%EQUATE `HHN_WINDOW_CREATE = %HHN_FIRST - 2
' // Size = 16 bytes
TYPE HHN_NOTIFY DWORD
 hdr AS NMHDR ' NMHDR hdr
 pszUrl AS ASCIIZ PTR ' PCSTR pszUrl; // Multi-byte, null-terminated string
END TYPE
' // Size = 52 bytes
TYPE HH_POPUP DWORD
 cbStruct AS LONG ' int cbStruct; // sizeof this structure
 hinst AS DWORD ' HINSTANCE hinst; // instance handle for string resource
 idString AS DWORD ' UINT idString; // string resource id, or text id if pszFile is specified in HtmlHelp call
 pszText AS ASCIIZ PTR ' LPCTSTR pszText; // used if idString is zero
 pt AS POINT ' POINT pt; // top center of popup window
 clrForeground AS DWORD ' COLORREF clrForeground; // use -1 [BITS(DWORD, -1)] for default
 clrBackground AS DWORD ' COLORREF clrBackground; // use -1 [BITS(DWORD, -1)] for default
 rcMargins AS RECT ' RECT rcMargins; // amount of space between edges of window and text, -1 for each member to ignore
 pszFont AS ASCIIZ PTR ' fLPCTSTR pszFont; // facename, point size, char set, BOLD ITALIC UNDERLINE
END TYPE
' // Size = 32 bytes
TYPE HH_AKLINK DWORD
 cbStruct AS LONG ' int cbStruct; // sizeof this structure
 fReserved AS LONG ' BOOL fReserved; // must be FALSE (really!)
 pszKeywords AS ASCIIZ PTR ' LPCTSTR pszKeywords; // semi-colon separated keywords
 pszUrl AS ASCIIZ PTR ' LPCTSTR pszUrl; // URL to jump to if no keywords found (may be NULL)
 pszMsgText AS ASCIIZ PTR ' LPCTSTR pszMsgText; // Message text to display in MessageBox if pszUrl is NULL and no keyword match
 pszMsgTitle AS ASCIIZ PTR ' LPCTSTR pszMsgTitle; // Message text to display in MessageBox if pszUrl is NULL and no keyword match
 pszWindow AS ASCIIZ PTR ' LPCTSTR pszWindow; // Window to display URL in
 fIndexOnFail AS LONG ' BOOL fIndexOnFail; // Displays index if keyword lookup fails.
END TYPE
' enum
%EQUATE `HHWIN_NAVTYPE_TOC = 0
%EQUATE `HHWIN_NAVTYPE_INDEX = 1
%EQUATE `HHWIN_NAVTYPE_SEARCH = 2
%EQUATE `HHWIN_NAVTYPE_FAVORITES = 3
%EQUATE `HHWIN_NAVTYPE_HISTORY = 4 ' not implemented
%EQUATE `HHWIN_NAVTYPE_AUTHOR = 5
%EQUATE `HHWIN_NAVTYPE_CUSTOM_FIRST = 11
' enum
%EQUATE `IT_INCLUSIVE = 0
%EQUATE `IT_EXCLUSIVE = 1
%EQUATE `IT_HIDDEN = 2
' // Size = 20 bytes
TYPE HH_ENUM_IT DWORD
 cbStruct AS LONG ' int cbStruct; // size of this structure
 iType AS LONG ' int iType; // the type of the information type ie. Inclusive, Exclusive, or Hidden
 pszCatName AS ASCIIZ PTR ' LPCSTR pszCatName; // Set to the name of the Category to enumerate the info types in a category; else NULL
 pszITName AS ASCIIZ PTR ' LPCSTR pszITName; // volitile pointer to the name of the infotype. Allocated by call. Caller responsible for freeing
 pszITDescription AS ASCIIZ PTR ' LPCSTR pszITDescription; // volitile pointer to the description of the infotype.
END TYPE
' // Size = 12 bytes
TYPE HH_ENUM_CAT DWORD
 cbStruct AS LONG ' int cbStruct; // size of this structure
 pszCatName AS ASCIIZ PTR ' LPCSTR pszCatName; // volitile pointer to the category name
 pszCatDescription AS ASCIIZ PTR ' LPCSTR pszCatDescription; // volitile pointer to the category description
END TYPE
' // Size = 12 bytes
TYPE HH_SET_INFOTYPE DWORD
 cbStruct AS LONG ' int cbStruct; // the size of this structure
 pszCatName AS ASCIIZ PTR ' LPCSTR pszCatName; // the name of the category, if any, the InfoType is a member of.
 pszInfoTypeName AS ASCIIZ PTR ' LPCSTR pszInfoTypeName; // the name of the info type to add to the filter
END TYPE
'typedef DWORD HH_INFOTYPE;
' enum
%EQUATE `HHWIN_NAVTAB_TOP = 0
%EQUATE `HHWIN_NAVTAB_LEFT = 1
%EQUATE `HHWIN_NAVTAB_BOTTOM = 2
'#define HH_MAX_TABS 19 // maximum number of tabs
%EQUATE `HH_MAX_TABS = 19 ' maximum number of tabs
' enum
%EQUATE `HH_TAB_CONTENTS = 0
%EQUATE `HH_TAB_INDEX = 1
%EQUATE `HH_TAB_SEARCH = 2
%EQUATE `HH_TAB_FAVORITES = 3
%EQUATE `HH_TAB_HISTORY = 4
%EQUATE `HH_TAB_AUTHOR = 5
%EQUATE `HH_TAB_CUSTOM_FIRST = 11
%EQUATE `HH_TAB_CUSTOM_LAST = %HH_MAX_TABS
%EQUATE `HH_MAX_TABS_CUSTOM = (%HH_TAB_CUSTOM_LAST - %HH_TAB_CUSTOM_FIRST) + 1
'// HH_DISPLAY_SEARCH Command Related Structures and Constants
'#define HH_FTS_DEFAULT_PROXIMITY (-1)
%EQUATE `HH_FTS_DEFAULT_PROXIMITY = -1&
' // Size = 32 bytes
TYPE HH_FTS_QUERY DWORD
 cbStruct AS LONG ' int cbStruct // Sizeof structure in bytes.
 fUniCodeStrings AS LONG ' BOOL fUniCodeStrings // TRUE if all strings are unicode.
 pszSearchQuery AS ASCIIZ PTR ' LPCTSTR pszSearchQuery // String containing the search query.
 iProximity AS LONG ' LONG iProximity // Word proximity.
 fStemmedSearch AS LONG ' BOOL fStemmedSearch // TRUE for StemmedSearch only.
 fTitleOnly AS LONG ' BOOL fTitleOnly // TRUE for Title search only.
 fExecute AS LONG ' BOOL fExecute // TRUE to initiate the search.
 pszWindow AS ASCIIZ PTR ' LPCTSTR pszWindow // Window to display in
END TYPE
'// HH_WINTYPE Structure
' // Size = 196 bytes
TYPE HH_WINTYPE DWORD
 cbStruct AS LONG ' int cbStruct // IN: size of this structure including all Information Types
 fUniCodeStrings AS LONG ' BOOL fUniCodeStrings // IN/OUT: TRUE if all strings are in UNICODE
 pszType AS ASCIIZ PTR ' LPCTSTR pszType // IN/OUT: Name of a type of window
 fsValidMembers AS DWORD ' DWORD fsValidMembers // IN: Bit flag of valid members (HHWIN_PARAM_)
 fsWinProperties AS DWORD ' DWORD fsWinProperties // IN/OUT: Properties/attributes of the window (HHWIN_)
 pszCaption AS ASCIIZ PTR ' LPCTSTR pszCaption // IN/OUT: Window title
 dwStyles AS DWORD ' DWORD dwStyles // IN/OUT: Window styles
 dwExStyles AS DWORD ' DWORD dwExStyles // IN/OUT: Extended Window styles
 rcWindowPos AS RECT ' RECT rcWindowPos // IN: Starting position, OUT: current position
 nShowState AS LONG ' int nShowState // IN: show state (e.g., SW_SHOW)
 hwndHelp AS DWORD ' HWND hwndHelp // OUT: window handle
 hwndCaller AS DWORD ' HWND hwndCaller // OUT: who called this window
 paInfoTypes AS DWORD PTR ' HH_INFOTYPE* paInfoTypes; // IN: Pointer to an array of Information Types
 ' The following members are only valid if HHWIN_PROP_TRI_PANE is set
 hwndToolBar AS DWORD ' HWND hwndToolBar // OUT: toolbar window in tri-pane window
 hwndNavigation AS DWORD ' HWND hwndNavigation // OUT: navigation window in tri-pane window
 hwndHTML AS DWORD ' HWND hwndHTML // OUT: window displaying HTML in tri-pane window
 iNavWidth AS LONG ' int iNavWidth // IN/OUT: width of navigation window
 rcHTML AS RECT ' RECT rcHTML // OUT: HTML window coordinates
 pszToc AS ASCIIZ PTR ' LPCTSTR pszToc // IN: Location of the table of contents file
 pszIndex AS ASCIIZ PTR ' LPCTSTR pszIndex // IN: Location of the index file
 pszFile AS ASCIIZ PTR ' LPCTSTR pszFile // IN: Default location of the html file
 pszHome AS ASCIIZ PTR ' LPCTSTR pszHome // IN/OUT: html file to display when Home button is clicked
 fsToolBarFlags AS DWORD ' DWORD fsToolBarFlags // IN: flags controling the appearance of the toolbar
 fNotExpanded AS LONG ' BOOL fNotExpanded // IN: TRUE/FALSE to contract or expand, OUT: current state
 curNavType AS LONG ' int curNavType // IN/OUT: UI to display in the navigational pane
 tabpos AS LONG ' int tabpos // IN/OUT: HHWIN_NAVTAB_TOP, HHWIN_NAVTAB_LEFT, or HHWIN_NAVTAB_BOTTOM
 idNotify AS LONG ' int idNotify // IN: ID to use for WM_NOTIFY messages
 tabOrder(%HH_MAX_TABS) AS BYTE ' BYTE tabOrder[HH_MAX_TABS + 1] // IN/OUT: tab order: Contents, Index, Search, History, Favorites, Reserved 1-5, Custom tabs
 cHistory AS LONG ' int cHistory // IN/OUT: number of history items to keep (default is 30)
 pszJump1 AS ASCIIZ PTR ' LPCTSTR pszJump1 // Text for HHWIN_BUTTON_JUMP1
 pszJump2 AS ASCIIZ PTR ' LPCTSTR pszJump2 // Text for HHWIN_BUTTON_JUMP2
 pszUrlJump1 AS ASCIIZ PTR ' LPCTSTR pszUrlJump1 // URL for HHWIN_BUTTON_JUMP1
 pszUrlJump2 AS ASCIIZ PTR ' LPCTSTR pszUrlJump2 // URL for HHWIN_BUTTON_JUMP2
 rcMinSize AS RECT ' RECT rcMinSize // Minimum size for window (ignored in version 1)
 cbInfoTypes AS LONG ' int cbInfoTypes // size of paInfoTypes;
 pszCustomTabs AS ASCIIZ PTR ' LPCTSTR pszCustomTabs // multiple zero-terminated strings
END TYPE
' enum
%EQUATE `HHACT_TAB_CONTENTS = 0
%EQUATE `HHACT_TAB_INDEX = 1
%EQUATE `HHACT_TAB_SEARCH = 2
%EQUATE `HHACT_TAB_HISTORY = 3
%EQUATE `HHACT_TAB_FAVORITES = 4
%EQUATE `HHACT_EXPAND = 5
%EQUATE `HHACT_CONTRACT = 6
%EQUATE `HHACT_BACK = 7
%EQUATE `HHACT_FORWARD = 8
%EQUATE `HHACT_STOP = 9
%EQUATE `HHACT_REFRESH = 10
%EQUATE `HHACT_HOME = 11
%EQUATE `HHACT_SYNC = 12
%EQUATE `HHACT_OPTIONS = 13
%EQUATE `HHACT_PRINT = 14
%EQUATE `HHACT_HIGHLIGHT = 15
%EQUATE `HHACT_CUSTOMIZE = 16
%EQUATE `HHACT_JUMP1 = 17
%EQUATE `HHACT_JUMP2 = 18
%EQUATE `HHACT_ZOOM = 19
%EQUATE `HHACT_TOC_NEXT = 20
%EQUATE `HHACT_TOC_PREV = 21
%EQUATE `HHACT_NOTES = 22
%EQUATE `HHACT_LAST_ENUM = 23
' // Size = 24 bytes
TYPE HHNTRACK DWORD
 hdr AS NMHDR ' NMHDR hdr
 pszCurUrl AS ASCIIZ PTR ' PCSTR pszCurUrl; // Multi-byte, null-terminated string
 idAction AS LONG ' int idAction; // HHACT_ value
 phhWinType AS HH_WINTYPE PTR ' HH_WINTYPE* phhWinType; // Current window type structure
END TYPE
DECLARE FUNCTION HtmlHelpA LIB "hhctrl.ocx" ALIAS "HtmlHelpA" ( BYVAL hwndCaller AS QUAD , BYREF pszFile AS ASCIIZ , BYVAL uCommand AS QUAD , BYVAL dwData AS QUAD ) AS QUAD
DECLARE FUNCTION HtmlHelpW LIB "hhctrl.ocx" ALIAS "HtmlHelpW" ( BYVAL hwndCaller AS QUAD
 , BYREF pszFile AS WSTRINGZ
 , BYVAL uCommand AS DWORD
 , BYVAL dwData AS DWORD
 ) AS DWORD
#IF %DEF(%UNICODE)
 MACRO HtmlHelp = HtmlHelpW
#ELSE
 MACRO HtmlHelp = HtmlHelpA
#ENDIF
'// Use the following for GetProcAddress to load from hhctrl.ocx
'#define ATOM_HTMLHELP_API_ANSI (LPTSTR)((DWORD)((WORD)(14)))
'#define ATOM_HTMLHELP_API_UNICODE (LPTSTR)((DWORD)((WORD)(15)))
%EQUATE `ATOM_HTMLHELP_API_ANSI = 14
%EQUATE `ATOM_HTMLHELP_API_UNICODE = 15
'///////////////////////////////////////////////////////////////////////////////
'//
'// Global Control Properties.
'//
' HH_GPROPID enum
%EQUATE `HH_GPROPID_SINGLETHREAD = 1 ' VARIANT_BOOL: True for single thread
%EQUATE `HH_GPROPID_TOOLBAR_MARGIN = 2 ' long: Provides a left/right margin around the toolbar.
%EQUATE `HH_GPROPID_UI_LANGUAGE = 3 ' long: LangId of the UI.
%EQUATE `HH_GPROPID_CURRENT_SUBSET = 4 ' BSTR: Current subset.
%EQUATE `HH_GPROPID_CONTENT_LANGUAGE = 5 ' long: LandId for desired content.
'///////////////////////////////////////////////////////////////////////////////
'//
'// Global Property structure
'//
'#ifdef __oaidl_h__
'#pragma pack(push, 8)
' // Size = 24 bytes
TYPE HH_GLOBAL_PROPERTY QWORD FILL
 id AS LONG ' HH_GPROPID id
 var AS tagVARIANT ' VARIANT var
END TYPE
#ENDIF
