Utility library CallStGuide() GrectCenter()
Programming guideline of WinDom

ShelWrite()

NAME

ShelWrite - Launch application.

PROTOTYPAGE

int ShelWrite( char *prg, char *cmd, void *env, int av, int single);

PARAMETERS

prg:
file to execute,

cmd:
command line or empty string,

env:
environ string or NULL,

av:
if TRUE, send a VA_START message if needed,

single:
if TRUE, execute in single mode,

return:
the id process of the application launched or -1 if error.

DESCRIPTION

ShelWrite() launches application in a easy way. Applications can be GEM application or TOS application. ShelWrite() uses the file name extension to identify the type of application (TOS programs have TOS or TTP suffix and GEM programs have APP, PRG or GTP suffix).

In a multitask environnment, applications are launched in parallel. With the parameter single, applications are lauched in single mode. If the parameter av is set to TRUE, a VA_START message is sent to the GEM application if it is running. Otherwise, a FALSE value has the consequent to create multiple application.

The parameter cmd describe the command line given to the application. The format is different of Pexec() or shel_write() (ie the first character does not contain the lenght of the string).

This function was backwardly nammed 'ExecGemApp()'.

BUGS

The ARGV protocol is not handled, the desktop accessores can not be launched.