A module, encapsulating the Win32 help API's.
-
Invokes the Windows Help system.
-
Create and returns an HH_AKLINK structure
-
Create and returns an HH_FTS_QUERY structure
-
Create and returns an HH_POPUP structure
-
Create and returns an HH_WINTYPE structure
-
Create and returns an NMHDR structure
-
Create and returns an HHN_NOTIFY structure
-
Create and returns an HHNTRACK structure
-
Invokes the Windows HTML Help system.
const win32help.HHACT_BACK;
const win32help.HHACT_CONTRACT;
const win32help.HHACT_CUSTOMIZE;
const win32help.HHACT_EXPAND;
const win32help.HHACT_FORWARD;
const win32help.HHACT_HIGHLIGHT;
const win32help.HHACT_HOME;
const win32help.HHACT_JUMP1;
const win32help.HHACT_JUMP2;
const win32help.HHACT_LAST_ENUM;
const win32help.HHACT_NOTES;
const win32help.HHACT_OPTIONS;
const win32help.HHACT_PRINT;
const win32help.HHACT_REFRESH;
const win32help.HHACT_STOP;
const win32help.HHACT_SYNC;
const win32help.HHACT_TAB_CONTENTS;
const win32help.HHACT_TAB_FAVORITES;
const win32help.HHACT_TAB_HISTORY;
const win32help.HHACT_TAB_INDEX;
const win32help.HHACT_TAB_SEARCH;
const win32help.HHACT_TOC_NEXT;
const win32help.HHACT_TOC_PREV;
const win32help.HHACT_ZOOM;
win32help.HHNTRACK
PyHHNTRACK = HHNTRACK() Creates a new HHNTRACK object.
const win32help.HHN_FIRST;
const win32help.HHN_LAST;
const win32help.HHN_NAVCOMPLETE;
win32help.HHN_NOTIFY
PyHHN_NOTIFY = HHN_NOTIFY() Creates a new HHN_NOTIFY object.
const win32help.HHN_TRACK;
const win32help.HHN_WINDOW_CREATE;
const win32help.HHWIN_BUTTON_BACK;
Back button
const win32help.HHWIN_BUTTON_BROWSE_BCK;
not implemented
const win32help.HHWIN_BUTTON_BROWSE_FWD;
not implemented
const win32help.HHWIN_BUTTON_CONTENTS;
not implemented
const win32help.HHWIN_BUTTON_EXPAND;
Expand/contract button
const win32help.HHWIN_BUTTON_FAVORITES;
not implemented
const win32help.HHWIN_BUTTON_FORWARD;
Forward button
const win32help.HHWIN_BUTTON_HISTORY;
not implemented
const win32help.HHWIN_BUTTON_HOME;
Home button
const win32help.HHWIN_BUTTON_INDEX;
not implemented
const win32help.HHWIN_BUTTON_JUMP1;
const win32help.HHWIN_BUTTON_JUMP2;
const win32help.HHWIN_BUTTON_NOTES;
not implemented
const win32help.HHWIN_BUTTON_OPTIONS;
Options button
const win32help.HHWIN_BUTTON_PRINT;
Print button
const win32help.HHWIN_BUTTON_REFRESH;
Refresh button
const win32help.HHWIN_BUTTON_SEARCH;
not implemented
const win32help.HHWIN_BUTTON_STOP;
Stop button
const win32help.HHWIN_BUTTON_SYNC;
Sync button
const win32help.HHWIN_BUTTON_TOC_NEXT;
const win32help.HHWIN_BUTTON_TOC_PREV;
const win32help.HHWIN_BUTTON_ZOOM;
const win32help.HHWIN_DEF_BUTTONS;
const win32help.HHWIN_NAVTAB_BOTTOM;
const win32help.HHWIN_NAVTAB_LEFT;
const win32help.HHWIN_NAVTAB_TOP;
const win32help.HHWIN_PARAM_CUR_TAB;
valid curNavType
const win32help.HHWIN_PARAM_EXPANSION;
valid notExpanded
const win32help.HHWIN_PARAM_EXSTYLES;
valid exStyles
const win32help.HHWIN_PARAM_HISTORY_COUNT;
valid cHistory
const win32help.HHWIN_PARAM_INFOTYPES;
valid apInfoTypes
const win32help.HHWIN_PARAM_NAV_WIDTH;
valid navWidth
const win32help.HHWIN_PARAM_PROPERTIES;
valid winProperties
const win32help.HHWIN_PARAM_RECT;
valid windowPos
const win32help.HHWIN_PARAM_SHOWSTATE;
valid showState
const win32help.HHWIN_PARAM_STYLES;
valid styles
const win32help.HHWIN_PARAM_TABORDER;
valid taborder
const win32help.HHWIN_PARAM_TABPOS;
valid tabpos
const win32help.HHWIN_PARAM_TB_FLAGS;
valid toolBarFlags
const win32help.HHWIN_PROP_AUTO_SYNC;
automatically ssync contents
and index
const win32help.HHWIN_PROP_CHANGE_TITLE;
Put current HTML title in
title bar
const win32help.HHWIN_PROP_MENU;
Menu
const win32help.HHWIN_PROP_NAV_ONLY_WIN;
Only display the navigation
window
const win32help.HHWIN_PROP_NODEF_EXSTYLES;
no default extended
window styles (only HH_WINTYPE.exStyles)
const win32help.HHWIN_PROP_NODEF_STYLES;
no default window styles
(only HH_WINTYPE.styles)
const win32help.HHWIN_PROP_NOTB_TEXT;
no text on toolbar buttons
const win32help.HHWIN_PROP_NOTITLEBAR;
no title bar
const win32help.HHWIN_PROP_NO_TOOLBAR;
Don't display a toolbar
const win32help.HHWIN_PROP_ONTOP;
Top-most window
const win32help.HHWIN_PROP_POST_QUIT;
post WM_QUIT message when
window closes
const win32help.HHWIN_PROP_TAB_ADVSEARCH;
Advanced FTS UI.
const win32help.HHWIN_PROP_TAB_AUTOHIDESHOW;
Automatically hide/show
tri-pane window
const win32help.HHWIN_PROP_TAB_CUSTOM1;
Use custom tab #1
const win32help.HHWIN_PROP_TAB_CUSTOM2;
Use custom tab #2
const win32help.HHWIN_PROP_TAB_CUSTOM3;
Use custom tab #3
const win32help.HHWIN_PROP_TAB_CUSTOM4;
Use custom tab #4
const win32help.HHWIN_PROP_TAB_CUSTOM5;
Use custom tab #5
const win32help.HHWIN_PROP_TAB_CUSTOM6;
Use custom tab #6
const win32help.HHWIN_PROP_TAB_CUSTOM7;
Use custom tab #7
const win32help.HHWIN_PROP_TAB_CUSTOM8;
Use custom tab #8
const win32help.HHWIN_PROP_TAB_CUSTOM9;
Use custom tab #9
const win32help.HHWIN_PROP_TAB_FAVORITES;
include favorites tab in
navigation pane
const win32help.HHWIN_PROP_TAB_HISTORY;
include history tab in
navigation pane
const win32help.HHWIN_PROP_TAB_SEARCH;
include search tab in
navigation pane
const win32help.HHWIN_PROP_TRACKING;
send tracking notification
messages
const win32help.HHWIN_PROP_TRI_PANE;
use a tri-pane window
const win32help.HHWIN_PROP_USER_POS;
After initial creation, user
controls window size/position
const win32help.HHWIN_TB_MARGIN;
the window type has a margin
win32help.HH_AKLINK
PyHH_AKLINK = HH_AKLINK() Creates a new HH_AKLINK object.
const win32help.HH_ALINK_LOOKUP;
ALink version of HH_KEYWORD_LOOKUP
const win32help.HH_CLOSE_ALL;
close all windows opened directly or
indirectly by the caller
const win32help.HH_DISPLAY_INDEX;
not currently implemented
const win32help.HH_DISPLAY_SEARCH;
not currently implemented
const win32help.HH_DISPLAY_TEXT_POPUP;
display string resource id
or text in a popup window
const win32help.HH_DISPLAY_TOC;
not currently implemented
const win32help.HH_DISPLAY_TOPIC;
const win32help.HH_ENUM_CATEGORY;
Get category name, call
repeatedly to enumerate, -1 at end
const win32help.HH_ENUM_CATEGORY_IT;
Get category info type members,
call repeatedly to enumerate, -1 at end
const win32help.HH_ENUM_INFO_TYPE;
Get Info type name, call
repeatedly to enumerate, -1 at end
const win32help.HH_FTS_DEFAULT_PROXIMITY;
win32help.HH_FTS_QUERY
PyHH_FTS_QUERY = HH_FTS_QUERY() Creates a new HH_FTS_QUERY object.
const win32help.HH_GET_LAST_ERROR;
not currently implemented
See HHERROR.h
const win32help.HH_GET_WIN_HANDLE;
const win32help.HH_GET_WIN_TYPE;
const win32help.HH_GPROPID_CONTENT_LANGUAGE;
long: LandId for desired
content.
const win32help.HH_GPROPID_CURRENT_SUBSET;
BSTR: Current subset.
const win32help.HH_GPROPID_SINGLETHREAD;
VARIANT_BOOL: True for single
thread
const win32help.HH_GPROPID_TOOLBAR_MARGIN;
long: Provides a left/right
margin around the toolbar.
const win32help.HH_GPROPID_UI_LANGUAGE;
long: LangId of the UI.
const win32help.HH_HELP_CONTEXT;
display mapped numeric value in
dwData
const win32help.HH_HELP_FINDER;
WinHelp equivalent
const win32help.HH_INITIALIZE;
Initializes the help system.
const win32help.HH_KEYWORD_LOOKUP;
const win32help.HH_MAX_TABS_CUSTOM;
win32help.HH_POPUP
PyHH_POPUP = HH_POPUP() Creates a new HH_POPUP object.
const win32help.HH_PRETRANSLATEMESSAGE;
Pumps messages.
(NULL, NULL, MSG*).
const win32help.HH_RESERVED1;
const win32help.HH_RESERVED2;
const win32help.HH_RESERVED3;
const win32help.HH_RESET_IT_FILTER;
Clear the info type filter of
all info types.
const win32help.HH_SET_EXCLUSIVE_FILTER;
set exclusive filtering
method for untyped topics to be excluded from display
const win32help.HH_SET_GLOBAL_PROPERTY;
Set a global property.
(NULL, NULL, HH_GPROP).
const win32help.HH_SET_INCLUSIVE_FILTER;
set inclusive filtering
method for untyped topics to be included in display
const win32help.HH_SET_INFO_TYPE;
Add Info type to filter.
const win32help.HH_SET_WIN_TYPE;
const win32help.HH_SYNC;
const win32help.HH_TAB_AUTHOR;
const win32help.HH_TAB_CONTENTS;
const win32help.HH_TAB_CUSTOM_FIRST;
const win32help.HH_TAB_CUSTOM_LAST;
const win32help.HH_TAB_FAVORITES;
const win32help.HH_TAB_HISTORY;
const win32help.HH_TAB_INDEX;
const win32help.HH_TAB_SEARCH;
const win32help.HH_TP_HELP_CONTEXTMENU;
text popup help, same as
WinHelp HELP_CONTEXTMENU
const win32help.HH_TP_HELP_WM_HELP;
text popup help, same as
WinHelp HELP_WM_HELP
const win32help.HH_UNINITIALIZE;
Uninitializes the help system.
win32help.HH_WINTYPE
PyHH_WINTYPE = HH_WINTYPE() Creates a new HH_WINTYPE object.
win32help.HtmlHelp
int = HtmlHelp(hwnd, file
, cmd
, data
) Invokes the Windows Html Help system.
-
hwnd : int
The handle of the window requesting help.
-
file : string/None
The name of the help file, or None.
-
cmd : int
The type of help. Valid values are:
HH_ALINK_LOOKUP
: Looks up one or more Associative link (ALink) names
in a compiled help (.chm) file.
The ALink names to search for, and the action to be taken if no matches
are found, are specified in the win32help::HH_AKLINK structure.
file
: Specifies a compiled help (.chm) file, or a specific topic
within a compiled help file.
data
: Specifies NULL or a pointer to a topic within a compiled help
file.
HH_CLOSE_ALL
: Closes all windows opened directly or indirectly by the
calling program. The args are not checked for type, values are set as
they "Must" be.
hwnd
: Must be None.
file
: Must be None.
data
: Must be zero.
HH_DISPLAY_INDEX
: Selects the Index tab in the Navigation pane of the
HTML Help Viewer and searches for the keyword specified in the data
parameter.
file
: Specifies a compiled help (.chm) file, or a specific topic
within a compiled help file.
data
: Specifies the keyword to select in the index (.hhk) file.
HH_DISPLAY_SEARCH
: Selects the Search tab in the Navigation pane of
the HTML Help Viewer and performs a search for the term specified in the
searchQuery parameter of the win32help::HH_FTS_QUERY structure.
file
: Specifies a compiled help (.chm) file, or a specific topic
within a compiled help file.
data
: Specifies a pointer to an win32help::HH_FTS_QUERY
structure.
HH_DISPLAY_TEXT_POPUP
: Opens a pop-up window that displays the
contents of one of the following:
An explicit text string.
A text string based on a resource ID.
A text string ID based on a text file contained in a compiled help (.chm)
file.
file
: To use an explicit text string, use None. To use a text
string from a resource, use None. To use text string from a text file
contained in a compiled help file, specify the .chm file and the text
file within the .chm file.
data
: Specifies a pointer to an win32help::HH_POPUP structure.
HH_DISPLAY_TOC
: Selects the Contents tab in the Navigation pane of
the HTML Help Viewer.
file
: Specifies a compiled help (.chm) file, or a specific topic
within a compiled help file.
data
: Specifies None or a pointer to a topic within a compiled help
file.
HH_DISPLAY_TOPIC
: Opens a help topic in a specified help window.
If a window type is not specified, a default window type is used. If the
window type or default window type is open, the help topic replaces the
current topic in the window.
file
: Specifies a compiled help (.chm) file, or a specific topic
within a compiled help file. To specify a defined window type, insert a
greater-than (>) character followed by the name of the window type.
data
: Specifies None or a pointer to a topic within a compiled help
file.
HH_GET_LAST_ERROR
: Returns information about the last error that
occurred in the HTML Help ActiveX control (Hhctrl.ocx).
file
: Must be None
data
: A pointer to a HH_LAST_ERROR structure.
Has not been implemented by Microsoft yet
HH_GET_WIN_HANDLE
: Returns the handle (hwnd) of a specified window
type.
file
: Specifies the name of the compiled help (.chm) file in which
the window type is defined.
data
: Specifies the name of the window type whose handle you want to
return.
HH_GET_WIN_TYPE
: Retrieves a pointer to the win32help::HH_WINTYPE
structure associated with a specified window type.
file
: Specifies the name of the window type whose information you
want to get and the name of the compiled help (.chm) file in which the
window type is defined. The window name must begin with a greater-than (>)
character and must be preceded by the name of the compiled help file it
is defined in.
data
: Ignored.
HH_HELP_CONTEXT
: Displays a help topic based on a mapped topic ID.
If a window type is not specified, a default window type is used. If the
window type or default window type is open, the help topic replaces the
current topic in the window.
file
: Specifies the compiled help (.chm) file that contains the
mapping information. To specify a defined window type, insert a
greater-than (>) character followed by the name of the window type.
data
: Specifies the numeric ID of the topic to display. You must map
symbolic IDs of dialog boxes to numeric IDs in the [MAP] section of your
project (.hhp) file.
HH_INITIALIZE
: This command initializes the help system for use and
must be the first HTML Help command called. It returns a cookie which must
be used in the HH_UNINITIALIZE
call. HH_INITIALIZE configures HTML Help
to run on the same thread as the calling application instead of a
secondary thread by setting the global property HH_GPROPID_SINGLETHREAD
to VARIANT_TRUE. Running HTML Help on the same thread as the calling
application requires the calling application to send messages to HTML Help
by calling the HH_PRETRANSLATEMESSAGE
command.
file
: Must be None.
data
: Ignored.
HH_KEYWORD_LOOKUP
: Looks up one or more keywords in a compiled help
(.chm) file. The keywords to search for and the action to be taken if
no matches are found are specified in the win32help::HH_AKLINK
structure.
file
: Specifies the compiled help (.chm) file that contains
keywords.
data
: Points to an win32help::HH_AKLINK structure.
HH_PRETRANSLATEMESSAGE
: This command is called in the message loop
of your Windows application to ensure proper handling of Windows
messages, especially keyboard messages when running HTML Help single
thread. The HTML Help API is not thread safe and must be called from one
and only one thread in a process.
file
data
: Points to a Win32 MSG structure.
Has not been implemented yet
HH_SET_WIN_TYPE
: Creates a new help window or modifies an existing
help window at run time.
file
: Specifies the name of the window type that you want to
create or modify and the name of the compiled help (.chm) file in which
the window type is defined. The window type name must begin with a
greater-than (>) character and must be preceded by the name of the
compiled help file in which it is defined.
data
: Points to an win32help::HH_WINTYPE structure.
HH_SYNC
: Locates and selects the contents entry for the help topic
that is open in the Topic pane of the HTML Help Viewer.
file
: Specifies the name of the window type that you want to
sync and the name of the compiled help (.chm) file in which the window
type is defined. The window type name must begin with a greater-than (>)
character and must be preceded by the name of the compiled help file in
which it is defined.
data
: Specifies a pointer to a topic within a compiled help file.
This value is the topic file to which the contents will synchronize.
HH_TP_HELP_CONTEXTMENU
: Opens a pop-up context menu. Generally used
in response to the Windows WM_CONTEXTMENU message. For example, this
message is sent when a user right-clicks a dialog box control.
hwnd
: Specifies the window handle of the dialog box control for
which you want pop-up help to appear. This is typically the control
that has focus.
file
: Specifies the compiled help (.chm) file, and the text
file that contains the pop-up help topics. By default, the text file is
named Cshelp.txt. If Cshelp.txt is located in the root of the compiled
help file, then you only need to specify the help file name. If not,
you must also specify the relative path.
data
: Specifies an array of DWORDs containing pairs of dialog
box control IDs and help topic IDs. The array must be terminated by zero,
as in the following example:
DWORD ids[3];
ids[0] = ControlId;
ids[1] = HelpId;
ids[2] = 0;
HH_TP_HELP_WM_HELP
: Opens a pop-up help topic. Generally used in
response to the Windows WM_HELP message. For example, this message is
sent when a user presses F1.
hwnd
: Specifies the window handle of the dialog box control for
which you want pop-up help to appear. This is typically the control that
has focus.
file
: Specifies the compiled help (.chm) file, and the text file
that contains the pop-up help topics. By default, the text file is named
Cshelp.txt. If Cshelp.txt is located in the root of the compiled help
file, then you only need to specify the help file name. If not, you must
also specify the relative path.
data
: Specifies an array of DWORDs containing pairs of dialog
box control IDs and help topic IDs. The array must be terminated by 0,
as in the following example:
DWORD ids[3];
ids[0] = ControlId;
ids[1] = HelpId;
ids[2] = 0;
HH_UNINITIALIZE
: This command is called to properly shut down HTML
Help. This function should be the last help command the application
calls. HH_UNINITIALIZE should not be called during DLL process detach,
but during the normal application shutdown process. The type of the
file arg is not checked, just set to the value it "Must" be.
file
: Must be None.
data
: Specifies a cookie. This is the cookie returned by
HH_INITIALIZE
.
- data=0 : None/int/string/int tuple/win32help::HH_AKLINK/
win32help::HH_FTS_QUERY/win32help::HH_POPUP/
Additional data specific to the help call\.
- Search for HtmlHelp at msdn, google or google groups.
Depending on the specified cmd and the result:
HH_GET_WIN_TYPE
:
tuple: (hwnd as below, and the win32help::HH_WINTYPE object).
Deep copy the structure to which dwData points before modifying the
structure.
HH_INITIALIZE
:
tuple: (hwnd as below, and the cookie).
This call returns a cookie that you must pass as the value of
data when you call HH_UNINITIALIZE
.
All other commands
:
HtmlHelp() returns one or both of the following:
The handle (hwnd) of the help window.
NULL. In some cases, NULL indicates failure; in other cases, NULL
indicates that the help window has not yet been created.
const win32help.IDTB_BACK;
const win32help.IDTB_BROWSE_BACK;
const win32help.IDTB_BROWSE_FWD;
const win32help.IDTB_CONTENTS;
not implemented
const win32help.IDTB_CONTRACT;
const win32help.IDTB_CUSTOMIZE;
const win32help.IDTB_EXPAND;
const win32help.IDTB_FAVORITES;
not implemented
const win32help.IDTB_FORWARD;
const win32help.IDTB_HISTORY;
not implemented
const win32help.IDTB_HOME;
const win32help.IDTB_INDEX;
not implemented
const win32help.IDTB_JUMP1;
const win32help.IDTB_JUMP2;
const win32help.IDTB_NOTES;
not implemented
const win32help.IDTB_OPTIONS;
const win32help.IDTB_PRINT;
const win32help.IDTB_REFRESH;
const win32help.IDTB_SEARCH;
not implemented
const win32help.IDTB_STOP;
const win32help.IDTB_SYNC;
const win32help.IDTB_TOC_NEXT;
const win32help.IDTB_TOC_PREV;
const win32help.IDTB_ZOOM;
win32help.NMHDR
PyNMHDR = NMHDR() Creates a new NMHDR object.
win32help.WinHelp
WinHelp(hwnd, hlpFile, cmd, data) Invokes the Windows Help system.
-
hwnd : int
The handle of the window requesting help.
-
hlpFile : string
The name of the help file.
-
cmd : int
The type of help. See the api for full details.
-
data=None : None/int/string
Additional data specific to the help call. Can be a buffer or pointer-sized int.
- Search for WinHelp at msdn, google or google groups.
The method raises an exception if an error occurs.
const win32help.debug;
1 if we are current using a _DEBUG build of
win32help, else 0.