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 PowerScript
function 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.
The Help event You can also include context Help messages for individual
menu items and controls in your application code.
For more information on the Help event, see the PowerScript
Reference
.
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).
For more information on the ShowHelp function,
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.
This example declares the WinHelp API:
1FUNCTION boolean WinHelpA(long hWndMain, &1string lpszHelp, long uCommand, &1long dwData) &1LIBRARY "USER32.DLL"Library names on UNIX The declaration above is for Windows. The declaration for
UNIX is the same except for the library name. On UNIX, the library
name has the form1libuser42.<i>x</i>where x depends
on the platform. For example, the extension is so on Solaris. - Click OK.
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 Application
Techniques
.