- Using a command line
- Application in the background: Specific case from Android 10
In french: LanceAppli
Starts the execution of a program (an executable for example) from the current application.
// Start Google Maps
Running an executable (in locking or non-locking mode) Hide the details
<Result> = ExeRun(<Program name> [, <Mode> [, <Wait for end> [, <Working directory>]]])
- True if the program was started,
- False otherwise. ErrorInfo returns more details about the error.
<Program name>: Character string
Name of program to start with its path and/or the parameters that must be passed to the program (if necessary).
- If no path is specified, the program is sought in the current directory, then in the Windows directory and in the directories accessible by PATH.
- If the executable corresponds to a long name with space characters, the following syntax must be used:
<Program name> = " " " Long_name_with_spaces" " Command_line"
Full name of the application to be started (with the package name) with the parameters to be passed to the program, if necessary.
Starting with Android 11
- Example: to start the Google Maps application, <Program name> corresponds to: "com.google.android.apps.maps".
- To specify parameters to be passed in command line, simply use the following notation:
<Program name> = <Package name> <Parameter name 1> = <Parameter value 1>
, the package name must be added in the application manifest. You can find an example at FAQ below: How to allow another application to be launched with ExeRun from an application in Android 11?
<Mode>: Optional integer constant
Program start mode (no action on DOS programs):
The program run is always active: it is run by "taking control" over the current program.
<Wait for end>: Optional Boolean constant
Configures the timeout before resuming the execution of the current program:
|The current program and the launched program run in parallel.|
|exeWait||The current program resumes its execution when the program run is over.|
The application can be started in non-locking mode only. A fatal error occurs if the exeWait
constant is used.
<Working directory>: Optional character string
Working directory of application to start.
This parameter is not available.
Using a command line
To pass parameters in command line to the executable run, you must specify the name and full path of the executable to run.
If the program run was developed with WINDEV or WINDEV Mobile, you can get the command line using CommandLine
Application in the background: Specific case from Android 10
From Android 10, it is no longer possible to open a window when the application is in the background.
ExeRun can open a window. If this function is used while the application is in the background, a fatal error will occur.
- It is possible to determine if the application is in the background using InBackgroundMode.
- If an application needs to interact with the user while it is in the background, the solution is to display a notification (via the Notification type). The application will be brought back to the foreground when the notification is clicked, if the ActivateApplication property is set to True. You can also open a window from the procedure passed to the ActionClick property.
This page is also available for…