Providing online Help for users
Two ways to call Help from an application
PowerBuilder provides two principal ways of calling an online
Help file from a PowerBuilder application:
- Use the ShowHelp and
ShowPopupHelp PowerScript functions in your application scripts
to call Help topics. - Declare the WinHelp API as an external function
and use the WinHelp function in your application scripts to call
Help topics.
Using ShowHelp
ShowHelp is simpler to implement than the WinHelp API. You
can use the ShowHelp PowerScript function to search for Help topics
by Help context ID, by keyword, and by accessing the Help file Contents
topic (the topic defined in the project file as the Help Contents
topic). ShowHelp can also be used with compiled HTML (.chm) files.
ShowPopupHelp displays popup help for a control. Typically,
you use ShowPopup Help in the Help event of a response window with
the Context Help property enabled. Events relating to movement of
the cursor over a control or to the dragging of a control or object
are also logical places for a ShowPopupHelp call.
For more information on the ShowHelp and ShowPopupHelp
functions, as well as the Help event, see the PowerScript
Reference
.
Using the WinHelp API
Declaring and using the WinHelp API allows access to the full
range of WinHelp functions, many of which are not available in ShowHelp.
For example, using the WinHelp function you can easily specify a
window type or window name in which to present a Help topic.
To declare the WinHelp API as an external function:
-
Select Declare>Global External
Functions from the menu bar of any painter that accesses the Script
view. -
Enter the function declaration in the textbox
and click OK.This example declares the WinHelp API:
1FUNCTION boolean WinHelpA(long hWndMain, &1string lpszHelp, long uCommand, &1long dwData) &1LIBRARY "USER32.DLL"
For more information about the WinHelp API,
see the online Help for the Microsoft Help Workshop or the documentation
for your Help authoring tool. For more information about declaring
and using global external functions, see the PowerScript
Reference
and “Using external functions”.
A collection of techniques you can use to implement
data access features in the applications you develop with PowerBuilder.
Includes using Transaction objects, graphs, rich text, and piping
data between data sources. The use of DataWindow objects and DataStores
for data access is described in the DataWindow Programmer’s
Guide
.