Running Applications from Help

You can run a Windows-based application from a Help file using the ExecProgram macro. You might find this useful for the following reasons:

nIf your Help file describes an application, you can run that application without forcing users to leave Help.

nYou can use the Help file as a way to organize and execute various applications.

nYou can incorporate applications to augment the information presented.

Once users quit the program, they return to Help and can continue reading information.

ExecProgram runs the specified program much the same as using the Run command from the File menu in Windows Program Manager. The .EXE and other necessary files for the application must either be on the PATH or be in the same directory as the .HPJ file for the Help file.

Usually, the ExecProgram macro is started when the user clicks a hot spot. But you can also include the macro as part of a hypergraphic or as the action taken when users choose a custom button or menu item.

The ExecProgram macro has the following syntax:

ExecProgram("command-line", display-state)

Command-line is the filename, enclosed in double quotation marks, of the application you want to run. Display-state is a number that specifies how the application window initially appears. Use 0 for normal size, 1 for minimized, and 2 for maximized.

In the following example, ExecProgram runs the Calendar application (in normal size) whenever a user clicks a CALENDAR.BMP bitmap:

!ExecProgram("calendar.exe", 0)

The application appears on top of the Help window, as shown in Figure 13.5.

Note:

For information about using the ExecProgram macro, see Chapter 14, “Help Macros” for more information about how to include macros in the Help file, see Chapter 15, “Help Macro Reference.” for information about using the ExecProgram macro.