'htmlhelp.sbp
'05/05/10
'06/09/10 最後まで書いた

' Commands to pass to HtmlHelp()

Const HH_DISPLAY_TOPIC = &H0000
Const HH_HELP_FINDER = &H0000 ' WinHelp equivalent
Const HH_DISPLAY_TOC = &H0001
Const HH_DISPLAY_INDEX = &H0002
Const HH_DISPLAY_SEARCH = &H0003
Const HH_SET_WIN_TYPE = &H0004
Const HH_GET_WIN_TYPE = &H0005
Const HH_GET_WIN_HANDLE = &H0006
Const HH_ENUM_INFO_TYPE = &H0007 ' Get Info type name, call repeatedly to enumerate, -1 at end
Const HH_SET_INFO_TYPE = &H0008 ' Add Info type to filter.
Const HH_SYNC = &H0009
Const HH_RESERVED1 = &H000A
Const HH_RESERVED2 = &H000B
Const HH_RESERVED3 = &H000C
Const HH_KEYWORD_LOOKUP = &H000D
Const HH_DISPLAY_TEXT_POPUP = &H000E ' display string resource id or text in a popup window
Const HH_HELP_CONTEXT = &H000F ' display mapped numeric value in dwData
Const HH_TP_HELP_CONTEXTMENU = &H0010 ' text popup help, same as WinHelp HELP_CONTEXTMENU
Const HH_TP_HELP_WM_HELP = &H0011 ' text popup help, same as WinHelp HELP_WM_HELP
Const HH_CLOSE_ALL = &H0012 ' close all windows opened directly or indirectly by the caller
Const HH_ALINK_LOOKUP = &H0013 ' ALink version of HH_KEYWORD_LOOKUP
Const HH_GET_LAST_ERROR = &H0014 ' not currently implemented ' See HHERROR.h
Const HH_ENUM_CATEGORY = &H0015
Const HH_ENUM_CATEGORY_IT = &H0016 ' Get category info type members, call repeatedly to enumerate, -1 at end
Const HH_RESET_IT_FILTER = &H0017 ' Clear the info type filter of all info types.
Const HH_SET_INCLUSIVE_FILTER = &H0018 ' set inclusive filtering method for untyped topics to be included in display
Const HH_SET_EXCLUSIVE_FILTER = &H0019 ' set exclusive filtering method for untyped topics to be excluded from display
Const HH_INITIALIZE = &H001C ' Initializes the help system.
Const HH_UNINITIALIZE = &H001D ' Uninitializes the help system.
Const HH_PRETRANSLATEMESSAGE = &H00fd ' Pumps messages. (NULL, NULL, MSG*).
Const HH_SET_GLOBAL_PROPERTY = &H00fc ' Set a global property. (NULL, NULL, HH_GPROP)

Const HHWIN_PROP_TAB_AUTOHIDESHOW = (1 << 0) ' Automatically hide/show tri-pane window
Const HHWIN_PROP_ONTOP = (1 << 1) ' Top-most window
Const HHWIN_PROP_NOTITLEBAR = (1 << 2) ' no title bar
Const HHWIN_PROP_NODEF_STYLES = (1 << 3) ' no default window styles (only HH_WINTYPE.dwStyles)
Const HHWIN_PROP_NODEF_EXSTYLES = (1 << 4) ' no default extended window styles (only HH_WINTYPE.dwExStyles)
Const HHWIN_PROP_TRI_PANE = (1 << 5) ' use a tri-pane window
Const HHWIN_PROP_NOTB_TEXT = (1 << 6) ' no text on toolbar buttons
Const HHWIN_PROP_POST_QUIT = (1 << 7) ' post WM_QUIT message when window closes
Const HHWIN_PROP_AUTO_SYNC = (1 << 8) ' automatically ssync contents and index
Const HHWIN_PROP_TRACKING = (1 << 9) ' send tracking notification messages
Const HHWIN_PROP_TAB_SEARCH = (1 << 10) ' include search tab in navigation pane
Const HHWIN_PROP_TAB_HISTORY = (1 << 11) ' include history tab in navigation pane
Const HHWIN_PROP_TAB_FAVORITES = (1 << 12) ' include favorites tab in navigation pane
Const HHWIN_PROP_CHANGE_TITLE = (1 << 13) ' Put current HTML title in title bar
Const HHWIN_PROP_NAV_ONLY_WIN = (1 << 14) ' Only display the navigation window
Const HHWIN_PROP_NO_TOOLBAR = (1 << 15) ' Don't display a toolbar
Const HHWIN_PROP_MENU = (1 << 16) ' Menu
Const HHWIN_PROP_TAB_ADVSEARCH = (1 << 17) ' Advanced FTS UI.
Const HHWIN_PROP_USER_POS = (1 << 18) ' After initial creation, user controls window size/position
Const HHWIN_PROP_TAB_CUSTOM1 = (1 << 19) ' Use custom tab #1
Const HHWIN_PROP_TAB_CUSTOM2 = (1 << 20) ' Use custom tab #2
Const HHWIN_PROP_TAB_CUSTOM3 = (1 << 21) ' Use custom tab #3
Const HHWIN_PROP_TAB_CUSTOM4 = (1 << 22) ' Use custom tab #4
Const HHWIN_PROP_TAB_CUSTOM5 = (1 << 23) ' Use custom tab #5
Const HHWIN_PROP_TAB_CUSTOM6 = (1 << 24) ' Use custom tab #6
Const HHWIN_PROP_TAB_CUSTOM7 = (1 << 25) ' Use custom tab #7
Const HHWIN_PROP_TAB_CUSTOM8 = (1 << 26) ' Use custom tab #8
Const HHWIN_PROP_TAB_CUSTOM9 = (1 << 27) ' Use custom tab #9
Const HHWIN_TB_MARGIN = (1 << 28) ' the window type has a margin

Const HHWIN_PARAM_PROPERTIES = (1 << 1) ' valid fsWinProperties
Const HHWIN_PARAM_STYLES = (1 << 2) ' valid dwStyles
Const HHWIN_PARAM_EXSTYLES = (1 << 3) ' valid dwExStyles
Const HHWIN_PARAM_RECT = (1 << 4) ' valid rcWindowPos
Const HHWIN_PARAM_NAV_WIDTH = (1 << 5) ' valid iNavWidth
Const HHWIN_PARAM_SHOWSTATE = (1 << 6) ' valid nShowState
Const HHWIN_PARAM_INFOTYPES = (1 << 7) ' valid apInfoTypes
Const HHWIN_PARAM_TB_FLAGS = (1 << 8) ' valid fsToolBarFlags
Const HHWIN_PARAM_EXPANSION = (1 << 9) ' valid fNotExpanded
Const HHWIN_PARAM_TABPOS = (1 << 10) ' valid tabpos
Const HHWIN_PARAM_TABORDER = (1 << 11) ' valid taborder
Const HHWIN_PARAM_HISTORY_COUNT = (1 << 12) ' valid cHistory
Const HHWIN_PARAM_CUR_TAB = (1 << 13) ' valid curNavType

Const HHWIN_BUTTON_EXPAND = (1 << 1) ' Expand/contract button
Const HHWIN_BUTTON_BACK = (1 << 2) ' Back button
Const HHWIN_BUTTON_FORWARD = (1 << 3) ' Forward button
Const HHWIN_BUTTON_STOP = (1 << 4) ' Stop button
Const HHWIN_BUTTON_REFRESH = (1 << 5) ' Refresh button
Const HHWIN_BUTTON_HOME = (1 << 6) ' Home button
Const HHWIN_BUTTON_BROWSE_FWD = (1 << 7) ' not implemented
Const HHWIN_BUTTON_BROWSE_BCK = (1 << 8) ' not implemented
Const HHWIN_BUTTON_NOTES = (1 << 9) ' not implemented
Const HHWIN_BUTTON_CONTENTS = (1 << 10) ' not implemented
Const HHWIN_BUTTON_SYNC = (1 << 11) ' Sync button
Const HHWIN_BUTTON_OPTIONS = (1 << 12) ' Options button
Const HHWIN_BUTTON_PRLong = (1 << 13) ' Print button
Const HHWIN_BUTTON_INDEX = (1 << 14) ' not implemented
Const HHWIN_BUTTON_SEARCH = (1 << 15) ' not implemented
Const HHWIN_BUTTON_HISTORY = (1 << 16) ' not implemented
Const HHWIN_BUTTON_FAVORITES = (1 << 17) ' not implemented
Const HHWIN_BUTTON_JUMP1 = (1 << 18)
Const HHWIN_BUTTON_JUMP2 = (1 << 19)
Const HHWIN_BUTTON_ZOOM = (1 << 20)
Const HHWIN_BUTTON_TOC_NEXT = (1 << 21)
Const HHWIN_BUTTON_TOC_PREV = (1 << 22)

Function HHWIN_DEF_BUTTONS() As DWord
HHWIN_DEF_BUTTONS = HHWIN_BUTTON_BACK or HHWIN_BUTTON_OPTIONS or HHWIN_BUTTON_PRINT
End Function

' 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_PRLong = 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 = (0-860)
Const HHN_LAST = (0-879)

Const HHN_NAVCOMPLETE = (HHN_FIRST-0)
Const HHN_TRACK = (HHN_FIRST-1)
Const HHN_WINDOW_CREATE = (HHN_FIRST-2)

'NMHDR
Type dummyNMHDR
hwndFrom As HWND
idFrom As DWord
code As DWord
End Type

Type HHN_NOTIFY
hdr As dummyNMHDR
pszUrl As *Byte ' Multi-byte, null-terminated string
End Type

Type HH_POPUP
cbStruct As Long ' sizeof this structure
hinst As DWord ' instance handle for string resource
idString As DWord ' string resource id, or text id if pszFile is specified in HtmlHelp call
pszText As *Byte ' used if idString is zero
pt As POINTAPI ' top center of popup window
clrForeground As Dword ' use -1 for default
clrBackground As Dword ' use -1 for default
rcMargins As RECT ' amount of space between edges of window and text, -1 for each member to ignore
pszFont As *Byte ' facename, point size, char set, BOLD ITALIC UNDERLINE
End Type

Type HH_AKLINK
cbStruct As Long ' sizeof this structure
fReserved As Long ' must be FALSE (really!)
pszKeywords As *Byte ' semi-colon separated keywords
pszUrl As *Byte ' URL to jump to if no keywords found (may be NULL)
pszMsgText As *Byte ' Message text to display in MessageBox if pszUrl is NULL and no keyword match
pszMsgTitle As *Byte ' Message text to display in MessageBox if pszUrl is NULL and no keyword match
pszWindow As *Byte ' Window to display URL in
fIndexOnFail As Long ' Displays index if keyword lookup fails.
End Type

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
End Enum

Enum
IT_INCLUSIVE,
IT_EXCLUSIVE,
IT_HIDDEN,
End Enum

Type HH_ENUM_IT
cbStruct As Long ' size of this structure
iType As Long ' the type of the information type ie. Inclusive, Exclusive, or Hidden
pszCatName As *Byte ' Set to the name of the Category to enumerate the info types in a category As else NULL
pszITName As *Byte ' volitile pointer to the name of the infotype. Allocated by call. Caller responsible for freeing
pszITDescription As *Byte ' volitile pointer to the description of the infotype.
End Type

Type HH_ENUM_CAT
cbStruct As Long ' size of this structure
pszCatName As *Byte ' volitile pointer to the category name
pszCatDescription As *Byte ' volitile pointer to the category description
End Type

Type HH_SET_INFOTYPE
cbStruct As Long ' the size of this structure
pszCatName As *Byte ' the name of the category, if any, the InfoType is a member of.
pszInfoTypeName As *Byte ' the name of the info type to add to the filter
End Type


Typedef HH_INFOTYPE = DWord
Typedef PHH_INFOTYPE = *HH_INFOTYPE


Const HHWIN_NAVTAB_TOP=0
Const HHWIN_NAVTAB_LEFT=1
Const HHWIN_NAVTAB_BOTTOM=2


Const HH_MAX_TABS =19 ' maximum number of tabs

Const HH_TAB_CONTENTS=0
Const HH_TAB_INDEX=1
Const HH_TAB_SEARCH=2
Const HH_TAB_FAVORITES=3
Const HH_TAB_HISTORY=4
Const HH_TAB_AUTHOR=5

Const HH_TAB_CUSTOM_FIRST = 11
Const 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 andConstants

Const HH_FTS_DEFAULT_PROXIMITY = (-1)

Type HH_FTS_QUERY
cbStruct As Long ' Sizeof structure in bytes.
fUniCodeStrings As Long ' TRUE if all strings are unicode.
pszSearchQuery As *Byte ' 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 *Byte ' Window to display in
End Type

' HH_WINTYPE Structure
Type HH_WINTYPE
cbStruct As Long ' IN: size of this structure including all Information Types
fUniCodeStrings As Long ' IN/OUT: TRUE if all strings are in UNICODE
pszType As *Byte ' IN/OUT: Name of a type of window
fsValidMembers As DWord ' IN: Bit flag of valid members (HHWIN_PARAM_)
fsWinProperties As DWord ' IN/OUT: Properties/attributes of the window (HHWIN_)

pszCaption As *Byte ' IN/OUT: Window title
dwStyles As DWord ' IN/OUT: Window styles
dwExStyles As DWord ' 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 HWND ' OUT: window handle
hwndCaller As HWND ' OUT: who called this window

paInfoTypes As *HH_INFOTYPE ' IN: Pointer to an array of Information Types

' The following members are only valid if HHWIN_PROP_TRI_PANE is set

hwndToolBar As DWord ' OUT: toolbar window in tri-pane window
hwndNavigation As DWord ' OUT: navigation window in tri-pane window
hwndHTML As DWord ' OUT: window displaying HTML in tri-pane window
iNavWidth As DWord ' IN/OUT: width of navigation window
rcHTML As RECT ' OUT: HTML window coordinates

pszToc As *Byte ' IN: Location of the table of contents file
pszIndex As *Byte ' IN: Location of the index file
pszFile As *Byte ' IN: Default location of the html file
pszHome As *Byte ' IN/OUT: html file to display when Home button is clicked
fsToolBarFlags As Dword ' IN: flags controling the appearance of the toolbar
fNotExpanded As Long ' IN: 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: tab 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 *Byte ' Text for HHWIN_BUTTON_JUMP1
pszJump2 As *Byte ' Text for HHWIN_BUTTON_JUMP2
pszUrlJump1 As *Byte ' URL for HHWIN_BUTTON_JUMP1
pszUrlJump2 As *Byte ' URL for HHWIN_BUTTON_JUMP2
rcMinSize As RECT ' Minimum size for window (ignored in version 1)
cbInfoTypes As Long ' size of paInfoTypes As
pszCustomTabs As *Byte ' multiple zero-terminated strings
End Type

Const HHACT_TAB_CONTENTS =0
Const HHACT_TAB_INDEX =1
Const HHACT_TAB_SEARCH=2
Const HHACT_TAB_HISTORY=3
Const HHACT_TAB_FAVORITES=4

Const HHACT_EXPAND=5
Const HHACT_CONTRACT=6
Const HHACT_BACK=7
Const HHACT_FORWARD=8
Const HHACT_STOP=9
Const HHACT_REFRESH=10
Const HHACT_HOME=11
Const HHACT_SYNC=12
Const HHACT_OPTIONS=13
Const HHACT_PRINT=14
Const HHACT_HIGHLIGHT=15
Const HHACT_CUSTOMIZE=16
Const HHACT_JUMP1=17
Const HHACT_JUMP2=18
Const HHACT_ZOOM=19
Const HHACT_TOC_NEXT=20
Const HHACT_TOC_PREV=21
Const HHACT_NOTES=22

Const HHACT_LAST_ENUM=23


Type HHNTRACK
hdr As dummyNMHDR
pszCurUrl As *Byte ' Multi-byte, null-terminated string
idAction As Long ' HHACT_ value
phhWinType As HH_WINTYPE ' Current window type structure
End Type



Declare Function HtmlHelp Lib "HHCtrl.ocx" Alias "HtmlHelpA" ( _
hwndCaller As HWND, _
pszFile As *Byte, _
uCommand As Dword, _
dwData As Dword) As Dword