RunApplication() generate/enh74c.jpg


Run (execute) another Windows program.

Syntax

RunApplication(<cCommandLine>, [<nShow>], [<cParams>]) --> nResult

Arguments

<cCommandLine> --> is the command line to request Windows to execute. This may include the program name and path or the program name and path and its parameter switches.

<nShow> --> Controls how the application is displayed when it is started. Values are indicated below:

 

Value

Description

0

Hide display of application.

1

Normal display.

2

Start as an icon (minimised on taskbar).

3

Show maximised to take up full screen.

4

Show but do not change focus.

The default value is 1 if the parameter is not passed.

<cParams> --> A character string containing parameters to pass to the application.

Returns

A numeric value is returned indicating the result of the request. Any value less than 32 indicates that an error condition has occurred. Common failure return values are listed below:

Value

Description

0

out of memory or could not execute (requested program file may be invalid)

2

program not found

3

invalid path

5

sharing or network violation

6

windows library error

8

out of memory

10

wrong Windows version for application being run

11

invalid executable file

16

an attempt was made to run multiple copies of an application when this was not permitted by the application or operating system

20

a required DLL was invalid or corrupt

Description

This is a special purpose function designed to start another Windows applications. This might be useful if you needed to set-up a communications link with this other application. You should first determine if the application is already running by using FindWindow() to locate its window name.

Example

This scripts requests that the application "EMailer" be started with the switch setting "/icon".

RunApplication("c:\capital\EMailer.exe /icon")

____________________________

Related Topics:

Business Function List

Shell()



CAPITAL VISUAL BUILDER