trm_run_program_ex()

Purpose

Runs another program

Syntax

int trm_run_program_ex(const char *command, int batch, int flags,int * exit_code);

Parameters

char* name

Name of program to run

 

int batch

If the program cannot be executed directly and this parameter is TRUE the terminal manager uses the shell to execute the command. On Windows a value of 2 will cause the ShellExecute() function to be used to execute the command. In this case command wil normally just be a document name, and the program to be executed will be selected based on the registry information. This is useful where you want to invoke the user's preferred web browser to open a web page, for example.

 

int flags

This can contain a combination of the TR_ flags in dp4uiapi.h. Not all the flags are meaningful on all platforms. For example the TR_NOWAIT parameter is not supported on MS-DOS.

 

int *exit_code

On return contains the exit code of the program that was executed, if available, and -1 otherwise. The exit code is only available on WIN32 platforms, and for programs run with the TR_WAIT flag specified. The exit code is not available if the executed program was a 16 bit Windows program and the machine is running an NT based version of Windows.

Description

The trm_run_program_ex() function is used to run another program where the exit code of the program is required.

Return values

Returns TRUE if the named program is successfully executed, otherwise FALSE.