
252
USING ROBOHELP HTML 9
Context-sensitive Help
Last updated 12/14/2011
Using
ShowHelpContext
makes maintaining context-sensitive Help much easier because if a topic name changes, only
one function has to be modified. The context IDs (for example, HH_GADGET_DIALOG) should be declared in a
header file that can be shared among the program modules that use context-sensitive WebHelp or WebHelp Pro. This
can be the same file where the prototypes for
ShowHelp
and
ShowHelpContext
are defined.
Programming HTML Help in applications
Note:
Microsoft HTML Help projects only.
Window-level Help for Windows applications
•
To call a topic using a map number, make a call to the HTML Help API using the following syntax:
HWND HtmlHelp(Window(), "c:\path\helpfile.chm", HH_HELP_CONTEXT, Number);
•
To call a topic using a filename, make a call to the HTML Help API using the following syntax:
HWND HtmlHelp (Dialog(), "c:\path\helpfile.chm", HH_DISPLAY_TOPIC, "topicfile.htm");
What’s This? Help for Windows applications
The method for programming What’s This? Help depends on the way the context-sensitive Help was created.
•
If the Help was created in RoboHelp as text-only topic files, see your software development kit for details.
•
If the Help was created in What’s This? Help Composer, see “
Create What's This? Help
” on page 259.
Note:
For more information, see the HTML Help API Reference at
http://msdn.microsoft.com/en-
us/library/ms670068(VS.85).aspx
.
Window-level Help for non-Windows platforms
•
Use WebHelp to display context-sensitive Help topics for C++ and Visual Basic applications, Java applications, and
Web pages. For more information, see “
WebHelp
” on page 249.
•
Use JavaHelp to display context-sensitive Help topics for Java applications. For more information, see “
Create
context-sensitive JavaHelp
” on page 254.
•
Use Oracle Help to display context-sensitive Help topics for Java applications, or applications written in other
programming languages. For more information, see “
Create context-sensitive Oracle Help
” on page 255.
Note:
If you must use your HTML Help output as a backup to a WebHelp, WebHelp Pro, FlashHelp, or FlashHelp Pro
system that is on a server, use Adobe's airplane Help.
Context-sensitive HTML Help function call
Sample code:
HtmlHelp(hWnd, /*Window handle of program or dialog*/
"CSHHelp.chm", /*Name of the CHM file*/
HH_HELP_CONTEXT,
dwMapNumber); /*Map number from map file*/
HtmlHelp(hWnd
Program or dialog box window handle. A window handle identifies a window so the HTML Help
engine discovers what application is performing the action.
CSHHelp.chm
Compiled HTML help file. It includes context-sensitive help. Give the developer this file for use with
the application.
HH_HELP_CONTEXT
This is the command sent to the HTML Help engine for window-level Help. (A command such
as HH_TP_HELP_WM_HELP is used for What's This? Help.)