Since the demise of WinHlp32.exe with the advent of Windows Vista, (as of 2015, it was still possible to get a cut-down version of WinHlp32.exe from the Microsoft website for all versions up to and including Windows 8), all Help files have been written using the HTML Help (.chm) format. Unfortunately, many of GFABasic's internal Help calling seems to be hard-wired to direct any WM_HELP message to seek WinHlp32.exe - for example, ShowHelp and the help button added through Message Boxes.
Therefore, this page is dedicated to explain how to call HTML Help files and how to workaround some of the intransigencies of GFABasic in this regard.
There are four API functions which you can use to open and access pages with the .chm file:
Declare Function HTMLHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" (ByVal hwndCaller As Long, ByVal pszFile As String, ByVal uCommand As Long, ByVal dwData As Long) As Long
Declare Function HTMLHelp_BaseCall Lib "hhctrl.ocx" Alias "HtmlHelpA" (ByVal hWndCaller As Long, ByVal lpHelpFile As String, ByVal uCommand As Long, ByVal dwData As Long) As Long
Declare Function HTMLHelpTopic Lib "hhctrl.ocx" Alias "HtmlHelpA" (ByVal hwndCaller As Long, ByVal pszFile As String, ByVal uCommand As Long, ByVal dwData As String) As Long
Declare Function HTMLHelpSearch Lib "hhctrl.ocx" Alias "HtmlHelpA" (ByVal hwndCaller As Long, ByVal pszFile As String, ByVal uCommand As Long, dwData As HH_FTS_QUERY) As Long
Note that all these can be declared with the 'HtmlHelpW' Alias to cater for Unicode help pages.
To augment these, you will need the following constants:
Const HH_DISPLAY_TOPIC = &H0 ' select last opened tab, [display a specified topic]
Const HH_DISPLAY_TOC = &H1 ' select contents tab, [display a specified topic]
Const HH_DISPLAY_INDEX = &H2 ' select index tab and searches for a keyword
Const HH_DISPLAY_SEARCH = &H3 ' select search tab (perform a search is fixed here)
Const HH_SET_WIN_TYPE = &H4
Const HH_GET_WIN_TYPE = &H5
Const HH_GET_WIN_HANDLE = &H6
Const HH_DISPLAY_TEXT_POPUP = &HE ' Display string resource ID or
Const HH_HELP_CONTEXT = &HF ' display mapped numeric value in dwData
Const HH_TP_HELP_CONTEXTMENU = &H10 ' Text pop-up help, similar to WinHelp
Const HH_TP_HELP_WM_HELP = &H11 ' text pop-up help, similar to WinHelp
Const HH_FTS_DEFAULT_PROXIMITY = -1
Const HH_MAX_TABS = 19 ' maximum number of tabs
Finally, if you wish to execute a search within the help file you will need the following Data type:
Type HH_FTS_QUERY
cbStruct As Long ' Sizeof structure in bytes.
fUniCodeStrings As Long ' TRUE if all strings are unicode.
pszSearchQuery As Long ' Pointer to a String containing the search query.
iProximity As Long ' Word proximity.
fStemmedSearch As Long ' TRUE for StemmedSearch only.
fTitleOnly As Long ' TRUE for Title search only.
fExecute As Long ' TRUE to initiate the search.
pszWindow As Long ' Pointer to a String detailing the Window to display in
End Type
All the above must be declared explicitly somewhere in the program.
Further Constants and Types can be found in the Additional Resources section below.
There are numerous methods that can be used for directly calling HTML Help files depending on the structure and contents of the help file itself, but for reasons of brevity, this page will focus on just one that will work with any file with a topic index.
The API that will be used is HHhWnd = HTMLHelpTopic(hWnd,HelpFilePath,Command,PageIndex) where HHhWnd is the handle of the HTMLHelp window, hWnd the handle of the calling window (always use Null), HelpFilePath is the full Help file path, Command is one of the constants - in this case HH_DISPLAY_INDEX - and PageIndex is one of the index words associated with the help page.
In the example below, when a command button is clicked, this help file will be opened and the page on MsgBox and Messages displayed.
Declare Function HTMLHelpTopic Lib "hhctrl.ocx" Alias "HtmlHelpA" (ByVal hwndCaller As Long, ByVal pszFile As String, _
ByVal uCommand As Long, ByVal dwData As String) As Long
Const HH_DISPLAY_INDEX = &H2
OpenW 1, 10, 10, 100, 100
Ocx Command cmd = "Call Help", 10, 10, TwipsToPixelX(Win_1.Width) - (Screen.cxFrame * 2) - 20, _
TwipsToPixelY(Win_1.Height) - (Screen.cyFrame * 2) - Screen.cyCaption - 20
Do : Sleep : Until Win_1 Is Nothing
Sub cmd_Click
HelpRoutine
EndSub
Procedure HelpRoutine
Local HHhWnd As Int32
// Find the filepath for this help file
Local d$ = GetSetting("\\HKEY_CLASSES_ROOT\Applications\GfaWin32.exe\shell\open\command", , ""), hp$
d$ = Left(d$, RInStr(d$, "\")) & "GFAWin32.chm" : If Left(d$, 1) = #34 Then d$ = Mid(d$, 2)
// Open the HTML Help file at the index page with 'msgbox' in the search box
HHhWnd = HTMLHelpTopic(Null, d$, HH_DISPLAY_INDEX, "msgbox")
// Ensure that HTML Help file has focus and simulate an 'Enter' key press to navigate to the required page
~SetForegroundWindow(HHhWnd) : SendKeys #13
EndProcedure
For the sake of the above example, the string 'message' could have been used instead as this too is an index to this page.
The last example is useful when calling help from a push button - or any other Ocx object - on a form or through the OnHelp, OnCtrlHelp and OnMenuHelp form events, as well as the OnHelp event when the 'Help' button is pressed on a CommDlg (see the relevant pages).
Some objects incorporate Help Buttons or other methods to call help within their structure and return any call made through a message (usually WM_HELP - see the Introduction above why it is inadvisable to use this) or a callback routine in the form of the Help Data Type structure. One good example of this is the Indirect Message Box (see here for why this API should be used instead of MsgBox and Message if you wish to include a help button) and the example below shows how this is done.
OpenW 1
Declare Function HTMLHelpTopic Lib "hhctrl.ocx" Alias "HtmlHelpA" (ByVal hwndCaller As Long, ByVal pszFile As String, _
ByVal uCommand As Long, ByVal dwData As String) As Long
Type MSGBOXPARAMS
- Long Size, Owner, hInstance
- Long Text, Caption, Style, Icon, ContextHelpId
- Long MsgBoxCallBack, LanguageId
EndType
Local mbp As MSGBOXPARAMS, a$ = "This is a trial MessageBox", b$ = "Trial Help"
mbp.Size = SizeOf(MSGBOXPARAMS)
mbp.Owner = Win_1.hWnd
mbp.hInstance = Null
mbp.Text = V:a$
mbp.Caption = V:b$
mbp.Style = MB_OK | MB_HELP
mbp.Icon = Null
mbp.ContextHelpId = 12
mbp.MsgBoxCallBack = ProcAddr(HelpRoutine)
Debug "Return Value:"; MessageBoxIndirect(mbp)
Do : Sleep : Until Win_1 Is Nothing
Procedure HelpRoutine(helpptr%)
Local hi As HELPINFO, HHhWnd As Int32
Local d$ = GetSetting("\\HKEY_CLASSES_ROOT\Applications\GfaWin32.exe\shell\open\command", , ""), hp$
Local Const HH_DISPLAY_INDEX = &H2
d$ = Left(d$, RInStr(d$, "\")) & "GFAWin32.chm" : If Left(d$, 1) = #34 Then d$ = Mid(d$, 2)
MemCpy V:hi, helpptr%, SizeOf(HELPINFO)
Select hi.ContextId
Case 12 : hp$ = "msgbox"
EndSelect
HHhWnd = HTMLHelpTopic(Null, d$, HH_DISPLAY_INDEX, hp$) : ~SetForegroundWindow(HHhWnd) : SendKeys #13
Type HELPINFO
- Long Size, ContextType, CtrlId
- Long ItemHandle, ContextId
MousePos As POINT
EndType
Type POINT
- Long x, y
EndType
EndProcedure
The 'Help' button in the MessageBox once more directs the user to the help page on Message Boxes through the call back routine HelpRoutine where the parameter helpptr% is the pointer to the Help data structure. This routing can be changed by altering the value of hp$ - for example, by changing it to 'HTML' you will get this page.
The HTMLHelp (or .chm) style of help file was introduced to replace the deprecated winhelp (or .hlp) format and was based on an Internet Explorer style browser; however, at the same time, most help files were starting to be deployed online rather than residing on the end-user's computer (this ensured, amongst other things, that, whether or not the end-user bothered to update a program, the help file was always up to date).
This switch to online help may have influenced Microsoft's support for HTMLHelp format help files as, although they created a functional browser through which to access them, a few proposed features were never implemented. These are minor but worth noting when deploying a help file and include the lack of 'Next' and 'Previous' buttons which navigate to the next/previous topic in the helpfile; other items not implemented include buttons for Index, Contents, Search, etc., but as these can be accessed through the tabs in the browser, this is of little or no consequence.
Generally, if called by the HTMLHelp API, the HTMLHelp file will be displayed using the old-fashioned command buttons, text boxes, etc. derived from Microsoft's Common Controls library v5 (see here for what this means). This does not affect the operation of the HTMLHelp browser in any way, but, if your main program uses Visual Styles, it may jar with the appearance and impression you are trying to create.
One way to make the HTMLHelp browser display the Visual Styles appropriate for the version of Windows on which it is to be run is to deploy a manifest file to directly influence the actions of the browser (file name hh.exe in the System32 folder); this is acceptable if you are simply deploying the help file on your own system but if it is to be deployed on other users' hardware, it might be considered bad practice as such an action would affect the appearance of the browser for ALL programs that called it.
The preferable method, which affects the browser only when it is invoked by the current application, is to apply Visual Styles through creating the HTMLHelp browser as a child window of your application and the easiest method for achieving this is to use the HTMLHelpTopic and HTMLHelpSearch APIs as follows:
Declare Function HTMLHelpTopic Lib "hhctrl.ocx" Alias "HtmlHelpA" (ByVal hwndCaller As Long, ByVal pszFile As String, _
ByVal uCommand As Long, ByVal dwData As String) As Long
Declare Function HTMLHelpSearch Lib "hhctrl.ocx" Alias "HtmlHelpA" (ByVal hwndCaller As Long, ByVal pszFile As String, _
ByVal uCommand As Long, dwData As HH_FTS_QUERY) As Long
Const HH_DISPLAY_TOPIC = &H0
Const HH_DISPLAY_TOC = &H1
Const HH_DISPLAY_INDEX = &H2
Const HH_DISPLAY_SEARCH = &H3
Type HH_FTS_QUERY
cbStruct As Long ' Sizeof structure in bytes.
fUniCodeStrings As Long ' TRUE if all strings are unicode.
pszSearchQuery As Long ' Pointer to a String containing the search query.
iProximity As Long ' Word proximity.
fStemmedSearch As Long ' TRUE for StemmedSearch only.
fTitleOnly As Long ' TRUE for Title search only.
fExecute As Long ' TRUE to initiate the search.
pszWindow As Long ' Pointer to a String detailing the Window to display in
End Type
Dim hfq As HH_FTS_QUERY, a$ = " "
With hfq
.cbStruct = SizeOf(HH_FTS_QUERY)
.fUniCodeStrings = 0
.pszSearchQuery = V:a$
.iProximity = 0
.fStemmedSearch = 0
.fTitleOnly = 0
.fExecute = 1
.pszWindow = 0
EndWith
// Find the filepath for this help file
Dim d$ = GetSetting("\\HKEY_CLASSES_ROOT\Applications\GfaWin32.exe\shell\open\command", , ""), hp$
d$ = Left(d$, RInStr(d$, "\")) & "GFAWin32.chm" : If Left(d$, 1) = #34 Then d$ = Mid(d$, 2)
Local n%
HTMLHelp_ViewIndex
KeyGet n%
HTMLHelp_ViewTopic
KeyGet n%
HTMLHelp_ViewSearch
KeyGet n%
Procedure HTMLHelp_ViewIndex
Local HHhWnd = HTMLHelpTopic(Null, d$, HH_DISPLAY_INDEX, "")
EndProcedure
Procedure HTMLHelp_ViewSearch
Local hhhwnd = HTMLHelpSearch(Null, d$, HH_DISPLAY_SEARCH, hfq)
EndProcedure
Procedure HTMLHelp_ViewTopic // Also Table of Contents
Local HHhWnd = HTMLHelpTopic(Null, d$, HH_DISPLAY_TOPIC, "")
EndProcedure
The following is an annotated conversion of the 'htmlhelp.h' file, a partially converted copy of which is also to be found in the Includes folder in the GB32 installation folder, giving a full list of all Constants and Types that can be used to manipulate the HTML Help viewer.
// Commands to pass to HtmlHelp()
'
Const HH_DISPLAY_TOPIC = 0x0000
Const HH_HELP_FINDER = 0x0000 // WinHelp equivalent
Const HH_DISPLAY_TOC = 0x0001
Const HH_DISPLAY_INDEX = 0x0002
Const HH_DISPLAY_SEARCH = 0x0003
Const HH_SET_WIN_TYPE = 0x0004
Const HH_GET_WIN_TYPE = 0x0005
Const HH_GET_WIN_HANDLE = 0x0006
Const HH_ENUM_INFO_TYPE = 0x0007 // Get Info type name, call repeatedly to enumerate, -1 at end
Const HH_SET_INFO_TYPE = 0x0008 // Add Info type to filter.
Const HH_SYNC = 0x0009
Const HH_RESERVED1 = 0x000A
Const HH_RESERVED2 = 0x000B
Const HH_RESERVED3 = 0x000C
Const HH_KEYWORD_LOOKUP = 0x000D
Const HH_DISPLAY_TEXT_POPUP = 0x000E // display string resource id or text in a popup window
Const HH_HELP_CONTEXT = 0x000F // display mapped numeric value in dwData
Const HH_TP_HELP_CONTEXTMENU = 0x0010 // text popup help, same as WinHelp HELP_CONTEXTMENU
Const HH_TP_HELP_WM_HELP = 0x0011 // text popup help, same as WinHelp HELP_WM_HELP
Const HH_CLOSE_ALL = 0x0012 // close all windows opened directly or indirectly by the caller
Const HH_ALINK_LOOKUP = 0x0013 // ALink version of HH_KEYWORD_LOOKUP
Const HH_GET_LAST_ERROR = 0x0014 // not currently implemented // See HHERROR.h
Const HH_ENUM_CATEGORY = 0x0015 // Get category name, call repeatedly to enumerate, -1 at end
Const HH_ENUM_CATEGORY_IT = 0x0016 // Get category info type members, call repeatedly to enumerate, -1 at end
Const HH_RESET_IT_FILTER = 0x0017 // Clear the info type filter of all info types.
Const HH_SET_INCLUSIVE_FILTER = 0x0018 // set inclusive filtering method for untyped topics to be included in display
Const HH_SET_EXCLUSIVE_FILTER = 0x0019 // set exclusive filtering method for untyped topics to be excluded from display
Const HH_INITIALIZE = 0x001C // Initializes the help system.
Const HH_UNINITIALIZE = 0x001D // Uninitializes the help system.
Const HH_SET_QUERYSERVICE = 0x001E // Set the Host IQueryService interface
Const HH_PRETRANSLATEMESSAGE = 0x00fd // Pumps messages. (NULL, NULL, MSG*).
Const HH_SET_GLOBAL_PROPERTY = 0x00fc // Set a global property. (NULL, NULL, HH_GPROP)
Const HH_SAFE_DISPLAY_TOPIC = 0x0020 // private addition to the interface for InternetExplorer.
'
// Window Properties
'
Const HHWIN_PROP_TAB_AUTOHIDESHOW = 0x0001 // Automatically hide/show tri-pane window
Const HHWIN_PROP_ONTOP = 0x0002 // Top-most window
Const HHWIN_PROP_NOTITLEBAR = 0x0004 // no title bar
Const HHWIN_PROP_NODEF_STYLES = 0x0008 // no default window styles (only HH_WINTYPE.dwStyles)
Const HHWIN_PROP_NODEF_EXSTYLES = 0x0010 // no default extended window styles (only HH_WINTYPE.dwExStyles)
Const HHWIN_PROP_TRI_PANE = 0x0020 // use a tri-pane window
Const HHWIN_PROP_NOTB_TEXT = 0x0040 // no text on toolbar buttons
Const HHWIN_PROP_POST_QUIT = 0x0080 // post WM_QUIT message when window closes
Const HHWIN_PROP_AUTO_SYNC = 0x0100 // automatically ssync contents and index
Const HHWIN_PROP_TRACKING = 0x0200 // send tracking notification messages
Const HHWIN_PROP_TAB_SEARCH = 0x0400 // include search tab in navigation pane
Const HHWIN_PROP_TAB_HISTORY = 0x0800 // include history tab in navigation pane
Const HHWIN_PROP_TAB_FAVORITES = 0x1000 // include favorites tab in navigation pane
Const HHWIN_PROP_CHANGE_TITLE = 0x2000 // Put current HTML title in title bar
Const HHWIN_PROP_NAV_ONLY_WIN = 0x4000 // Only display the navigation window
Const HHWIN_PROP_NO_TOOLBAR = 0x8000 // Don't display a toolbar
Const HHWIN_PROP_MENU = 0x10000 // Menu
Const HHWIN_PROP_TAB_ADVSEARCH = 0x20000 // Advanced FTS UI.
Const HHWIN_PROP_USER_POS = 0x40000 // After initial creation, user controls window size/position
Const HHWIN_PROP_TAB_CUSTOM1 = 0x80000 // Use custom tab #1
Const HHWIN_PROP_TAB_CUSTOM2 = 0x100000 // Use custom tab #2
Const HHWIN_PROP_TAB_CUSTOM3 = 0x200000 // Use custom tab #3
Const HHWIN_PROP_TAB_CUSTOM4 = 0x400000 // Use custom tab #4
Const HHWIN_PROP_TAB_CUSTOM5 = 0x800000 // Use custom tab #5
Const HHWIN_PROP_TAB_CUSTOM6 = 0x1000000 // Use custom tab #6
Const HHWIN_PROP_TAB_CUSTOM7 = 0x2000000 // Use custom tab #7
Const HHWIN_PROP_TAB_CUSTOM8 = 0x4000000 // Use custom tab #8
Const HHWIN_PROP_TAB_CUSTOM9 = 0x8000000 // Use custom tab #9
Const HHWIN_TB_MARGIN = 0x10000000 // the window type has a margin
'
// Window Parameters
'
Const HHWIN_PARAM_PROPERTIES = 0x0002 // valid fsWinProperties
Const HHWIN_PARAM_STYLES = 0x0004 // valid dwStyles
Const HHWIN_PARAM_EXSTYLES = 0x0008 // valid dwExStyles
Const HHWIN_PARAM_RECT = 0x0010 // valid rcWindowPos
Const HHWIN_PARAM_NAV_WIDTH = 0x0020 // valid iNavWidth
Const HHWIN_PARAM_SHOWSTATE = 0x0040 // valid nShowState
Const HHWIN_PARAM_INFOTYPES = 0x0080 // valid apInfoTypes
Const HHWIN_PARAM_TB_FLAGS = 0x0100 // valid fsToolBarFlags
Const HHWIN_PARAM_EXPANSION = 0x0200 // valid fNotExpanded
Const HHWIN_PARAM_TABPOS = 0x0400 // valid tabpos
Const HHWIN_PARAM_TABORDER = 0x0800 // valid taborder
Const HHWIN_PARAM_HISTORY_COUNT = 0x1000 // valid cHistory
Const HHWIN_PARAM_CUR_TAB = 0x2000 // valid curNavType
'
// Button Constants
'
Const HHWIN_BUTTON_EXPAND = 0x000002 // Expand/contract button
Const HHWIN_BUTTON_BACK = 0x000004 // Back button
Const HHWIN_BUTTON_FORWARD = 0x000008 // Forward button
Const HHWIN_BUTTON_STOP = 0x000010 // Stop button
Const HHWIN_BUTTON_REFRESH = 0x000020 // Refresh button
Const HHWIN_BUTTON_HOME = 0x000040 // Home button
Const HHWIN_BUTTON_BROWSE_FWD = 0x000080 // not implemented
Const HHWIN_BUTTON_BROWSE_BCK = 0x000100 // not implemented
Const HHWIN_BUTTON_NOTES = 0x000200 // not implemented
Const HHWIN_BUTTON_CONTENTS = 0x000400 // not implemented
Const HHWIN_BUTTON_SYNC = 0x000800 // Sync button
Const HHWIN_BUTTON_OPTIONS = 0x001000 // Options button
Const HHWIN_BUTTON_PRINT = 0x002000 // Print button
Const HHWIN_BUTTON_INDEX = 0x004000 // not implemented
Const HHWIN_BUTTON_SEARCH = 0x008000 // not implemented
Const HHWIN_BUTTON_HISTORY = 0x010000 // not implemented
Const HHWIN_BUTTON_FAVORITES = 0x020000 // not implemented
Const HHWIN_BUTTON_JUMP1 = 0x040000
Const HHWIN_BUTTON_JUMP2 = 0x080000
Const HHWIN_BUTTON_ZOOM = HHWIN_BUTTON_JUMP2 * 2
Const HHWIN_BUTTON_TOC_NEXT = HHWIN_BUTTON_ZOOM * 2
Const HHWIN_BUTTON_TOC_PREV = HHWIN_BUTTON_TOC_NEXT * 2
Const HHWIN_DEF_BUTTONS = HHWIN_BUTTON_EXPAND | HHWIN_BUTTON_BACK | HHWIN_BUTTON_OPTIONS | HHWIN_BUTTON_PRINT
'
// Button IDs
'
Const IDTB_EXPAND = 200
Const IDTB_CONTRACT = 201
Const IDTB_STOP = 202
Const IDTB_REFRESH = 203
Const IDTB_BACK = 204
Const IDTB_HOME = 205
Const IDTB_SYNC = 206
Const IDTB_PRINT = 207
Const IDTB_OPTIONS = 208
Const IDTB_FORWARD = 209
Const IDTB_NOTES = 210 // not implemented
Const IDTB_BROWSE_FWD = 211
Const IDTB_BROWSE_BACK = 212
Const IDTB_CONTENTS = 213 // not implemented
Const IDTB_INDEX = 214 // not implemented
Const IDTB_SEARCH = 215 // not implemented
Const IDTB_HISTORY = 216 // not implemented
Const IDTB_FAVORITES = 217 // not implemented
Const IDTB_JUMP1 = 218
Const IDTB_JUMP2 = 219
Const IDTB_CUSTOMIZE = 221
Const IDTB_ZOOM = 222
Const IDTB_TOC_NEXT = 223
Const IDTB_TOC_PREV = 224
'
// Notification codes
'
Const HHN_FIRST = -860 ' (0U-860U)
Const HHN_LAST = -879 ' (0U-879U)
'
Const HHN_NAVCOMPLETE = (HHN_FIRST - 0)
Const HHN_TRACK = (HHN_FIRST - 1)
Const HHN_WINDOW_CREATE = (HHN_FIRST - 2)
'
Type tagHHN_NOTIFY
hdr As NMHDR
pszUrl As Long // Multi-byte, null-terminated string
EndType
'
Type tagHH_POPUP
cbStruct As Long // sizeof this structure
HInstance As Handle // instance handle for string resource
idString As Long // string resource id, or text id if pszFile is specified in HtmlHelp call
pszText As Long // (pointer to string) used if idString is zero
pt As POINT // top center of popup window
clrForeground As Long // use -1 for default
clrBackground As Long // use -1 for default
rcMargins As RECT // amount of space between edges of window and text, -1 for each member to ignore
pszFont As Long // (pointer to string containing) facename, point size, char set, BOLD ITALIC UNDERLINE
EndType
'
Type tagHH_AKLINK
cbStruct As Long // Sizeof this structure
fReserved As Long // (boolean) must be FALSE
pszKeywords As Long // (pointer to string containing) semi-colon separated keywords
pszUrl As Long // (pointer to string containing) URL to jump to if no keywords found (may be NULL)
pszMsgText As Long // (pointer to string containing) Message text to display in MessageBox if pszUrl is NULL and no keyword match
pszMsgTitle As Long // (pointer to string containing) Message text to display in MessageBox if pszUrl is NULL and no keyword match
pszWindow As Long // (pointer to string containing) Window to display URL in
fIndexOnFail As Long // (boolean) Displays index if keyword lookup fails.
EndType
'
Enum HHWIN_NAVTYPE_TOC, HHWIN_NAVTYPE_INDEX, HHWIN_NAVTYPE_SEARCH, HHWIN_NAVTYPE_FAVORITES, HHWIN_NAVTYPE_HISTORY(* not implemented *), _
HHWIN_NAVTYPE_AUTHOR, HHWIN_NAVTYPE_CUSTOM_FIRST = 11
'
Enum IT_INCLUSIVE, IT_EXCLUSIVE, IT_HIDDEN
'
Type tagHH_ENUM_IT
cbStruct As Long // Sizeof this structure
iType As Long // The type of the information type ie. Inclusive, Exclusive, or Hidden
pszCatName As Long // (pointer to string containing) Set to the name of the Category to enumerate the info types in a category; else NULL
pszITName As Long // Volitile pointer to the name of the infotype. Allocated by call. Caller responsible for freeing
pszITDescription As Long // Volitile pointer to the description of the infotype.
EndType
'
Type HH_ENUM_CAT
cbStruct As Long // Sizeof this structure
pszCatName As Long // Volitile pointer to the category name
pszCatDescription As Long // Volitile pointer to the category description
EndType
'
Type HH_SET_INFOTYPE
cbStruct As Long // Sizeof this structure
pszCatName As Long // (pointer to string containing) the name of the category, if any, the InfoType is a member of.
pszInfoTypeName As Long // (pointer to string containing) the name of the info type to add to the filter
EndType
'
Enum HHWIN_NAVTAB_TOP, HHWIN_NAVTAB_LEFT, HHWIN_NAVTAB_BOTTOM
'
Const HH_MAX_TABS = 19 // maximum number of tabs
'
Enum HH_TAB_CONTENTS, HH_TAB_INDEX, HH_TAB_SEARCH, HH_TAB_FAVORITES, HH_TAB_HISTORY, HH_TAB_AUTHOR, HH_TAB_CUSTOM_FIRST = 11, HH_TAB_CUSTOM_LAST = HH_MAX_TABS
'
Const HH_MAX_TABS_CUSTOM = (HH_TAB_CUSTOM_LAST - HH_TAB_CUSTOM_FIRST + 1)
'
// HH_DISPLAY_SEARCH Command Related Structures and Constants
'
Const HH_FTS_DEFAULT_PROXIMITY = -1
'
Type HH_FTS_QUERY
cbStruct As Long // Sizeof this structure
fUniCodeStrings As Long // (Boolean) TRUE if all strings are unicode.
pszSearchQuery As Long // (pointer to string containing) the search query.
iProximity As Long // Word proximity.
fStemmedSearch As Long // (Boolean) TRUE for StemmedSearch only.
fTitleOnly As Long // (Boolean) TRUE for Title search only.
fExecute As Long // (Boolean) TRUE to initiate the search.
pszWindow As Long // (pointer to string containing) details of the Window to display in
EndType
'
// HH_WINTYPE Structure
'
Type HH_WINTYPE
cbStruct As Long // [IN] size of this structure including all Information Types
fUniCodeStrings As Long // [IN/OUT] (Boolean) TRUE if all strings are in UNICODE
pszType As Long // [IN/OUT] (pointer to string containing) the Name of a type of window
fsValidMembers As Long // [IN] Bit flag of valid members (HHWIN_PARAM_)
fsWinProperties As Long // [IN/OUT] Properties/attributes of the window (HHWIN_)
pszCaption As Long // [IN/OUT] (pointer to string containing) the Window title
dwStyles As Long // [IN/OUT] Window styles
dwExStyles As Long // [IN/OUT] Extended Window styles
rcWindowPos As RECT // [IN] Starting position, [OUT] current position
nShowState As Long // [IN] show state (e.g., SW_SHOW)
hwndHelp As Long // [OUT] window handle
hwndCaller As Long // [OUT] who called this window
paInfoTypes As Long // [IN] Pointer to an array of Information Types (HH_INFOTYPE)
(* The following members are only valid if HHWIN_PROP_TRI_PANE is set *)
hwndToolBar As Long // [OUT] toolbar window in tri-pane window
hwndNavigation As Long // [OUT] navigation window in tri-pane window
hwndHTML As Long // [OUT] window displaying HTML in tri-pane window
iNavWidth As Long // [IN/OUT] width of navigation window
rcHTML As RECT // [OUT] HTML window coordinates
pszToc As Long // [IN] (pointer to string containing) the Location of the table of contents file
pszIndex As Long // [IN] (pointer to string containing) the Location of the index file
pszFile As Long // [IN] (pointer to string containing) the Default location of the html file
pszHome As Long // [IN/OUT] (pointer to string containing) the html file to display when Home button is clicked
fsToolBarFlags As Long // [IN] flags controling the appearance of the toolbar
fNotExpanded As Long // [IN] (Boolean) TRUE/FALSE to contract or expand, [OUT] current state
curNavType As Long // [IN/OUT] UI to display in the navigational pane
tabpos As Long // [IN/OUT] HHWIN_NAVTAB_TOP, HHWIN_NAVTAB_LEFT, or HHWIN_NAVTAB_BOTTOM
idNotify As Long // [IN] ID to use for WM_NOTIFY messages
tabOrder(HH_MAX_TABS + 1) As Byte // [IN/OUT] (pointer to a Byte array oftab order: Contents, Index, Search, History, Favorites, Reserved 1-5, Custom tabs
cHistory As Long // [IN/OUT] number of history items to keep (default is 30)
pszJump1 As Long // (pointer to string containing) the Text for HHWIN_BUTTON_JUMP1
pszJump2 As Long // (pointer to string containing) the Text for HHWIN_BUTTON_JUMP2
pszUrlJump1 As Long // (pointer to string containing) the URL for HHWIN_BUTTON_JUMP1
pszUrlJump2 As Long // (pointer to string containing) the URL for HHWIN_BUTTON_JUMP2
rcMinSize As RECT // Minimum size for window (ignored in version 1)
cbInfoTypes As Long // size of paInfoTypes;
pszCustomTabs As Long // (pointer to string containing) the labels of the tabs as zero-terminated strings
EndType
'
Enum HHACT_TAB_CONTENTS, HHACT_TAB_INDEX, HHACT_TAB_SEARCH, HHACT_TAB_HISTORY, HHACT_TAB_FAVORITES, HHACT_EXPAND, HHACT_CONTRACT, HHACT_BACK, HHACT_FORWARD, _
HHACT_STOP, HHACT_REFRESH, HHACT_HOME, HHACT_SYNC, HHACT_OPTIONS, HHACT_PRINT, HHACT_HIGHLIGHT, HHACT_CUSTOMIZE, HHACT_JUMP1, HHACT_JUMP2, HHACT_ZOOM, HHACT_TOC_NEXT, _
HHACT_TOC_PREV, HHACT_NOTES, HHACT_LAST_ENUM
'
Type HHNTRACK
hdr As NMHDR
pszCurUrl As Long // (pointer to string containing) A multi-byte, zero-terminated string that specifies the current topic (before the action is taken).
idAction As Long // HHACT_ value
phhWinType As Long // Pointer to Current window type structure (HH_WINTYPE)
EndType
'
// Use the following for GetProcAddress to load from hhctrl.ocx
'
Const ATOM_HTMLHELP_API_ANSI = 14
Const ATOM_HTMLHELP_API_UNICODE = 15
'
///////////////////////////////////////////////////////////////////////////////
//
// Global Control Properties.
//
Const HH_GPROPID_SINGLETHREAD = 1 // VARIANT_BOOL: True for single thread
Const HH_GPROPID_TOOLBAR_MARGIN = 2 // LONG: Provides a left/right margin around the toolbar.
Const HH_GPROPID_UI_LANGUAGE = 3 // LONG: LangId of the UI.
Const HH_GPROPID_CURRENT_SUBSET = 4 // BSTR: Current subset.
Const HH_GPROPID_CONTENT_LANGUAGE = 5 // LONG: LandId for desired content.
'
///////////////////////////////////////////////////////////////////////////////
//
// Global Property structure
//
'
Type tagHH_GLOBAL_PROPERTY
id As Long // (HH_GPROPID)
var As Variant // Associated value
EndType
'
// General Types
'
Type NMHDR
hwndFrom As Long // A window handle to the control sending the message.
idFrom As Long // An identifier of the control sending the message.
code As Long // A notification code.
EndType
'
Type POINT
- Long x, y
EndType
'
Type RECT
- Long left, top, right, bottom
EndType
Next: Multithreading with GB32.
Back to: Creating An Application.
{Created by James Gaite; Last updated: 16/05/2020 by James Gaite}