PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Using a command line
  • Application in the background: Specific case from Android 10
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Starts the execution of a program (an executable for example) from the current application.
Versions 22 and later
Android This function is now available for Android applications.
Android Widget This function is now available in Android widget mode.
New in version 22
Android This function is now available for Android applications.
Android Widget This function is now available in Android widget mode.
Android This function is now available for Android applications.
Android Widget This function is now available in Android widget mode.
Example
Versions 22 and later
AndroidAndroid Widget
// Start Google Maps
ExeRun("com.google.android.apps.maps")
New in version 22
AndroidAndroid Widget
// Start Google Maps
ExeRun("com.google.android.apps.maps")
AndroidAndroid Widget
// Start Google Maps
ExeRun("com.google.android.apps.maps")
Syntax

Running an executable (in locking or non-locking mode) Hide the details

<Result> = ExeRun(<Program name> [, <Mode> [, <Wait for end> [, <Working directory>]]])
<Result>: Boolean
  • 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"
Versions 22 and later
AndroidAndroid Widget Full name of the application to be started (with the package name) with the parameters to be passed to the program, if necessary.
  • Example: to start the Google Maps application, <Program name> corresponds to: "com.google.android.apps.maps".
  • Versions 27 and later
    To specify parameters to be passed in command line, simply use the following notation:
    <Program name> = <Package name> <Parameter name 1> = <Parameter value 1>
    New in version 27
    To specify parameters to be passed in command line, simply use the following notation:
    <Program name> = <Package name> <Parameter name 1> = <Parameter value 1>
    To specify parameters to be passed in command line, simply use the following notation:
    <Program name> = <Package name> <Parameter name 1> = <Parameter value 1>
Starting with Android 11, 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?
New in version 22
AndroidAndroid Widget Full name of the application to be started (with the package name) with the parameters to be passed to the program, if necessary.
  • Example: to start the Google Maps application, <Program name> corresponds to: "com.google.android.apps.maps".
  • Versions 27 and later
    To specify parameters to be passed in command line, simply use the following notation:
    <Program name> = <Package name> <Parameter name 1> = <Parameter value 1>
    New in version 27
    To specify parameters to be passed in command line, simply use the following notation:
    <Program name> = <Package name> <Parameter name 1> = <Parameter value 1>
    To specify parameters to be passed in command line, simply use the following notation:
    <Program name> = <Package name> <Parameter name 1> = <Parameter value 1>
Starting with Android 11, 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?
AndroidAndroid Widget Full name of the application to be started (with the package name) with the parameters to be passed to the program, if necessary.
  • Example: to start the Google Maps application, <Program name> corresponds to: "com.google.android.apps.maps".
  • Versions 27 and later
    To specify parameters to be passed in command line, simply use the following notation:
    <Program name> = <Package name> <Parameter name 1> = <Parameter value 1>
    New in version 27
    To specify parameters to be passed in command line, simply use the following notation:
    <Program name> = <Package name> <Parameter name 1> = <Parameter value 1>
    To specify parameters to be passed in command line, simply use the following notation:
    <Program name> = <Package name> <Parameter name 1> = <Parameter value 1>
Starting with Android 11, 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):
exeActive
(Default value)
The program run is active, it "takes control" over the current program.
exeIconizeThe program run is inactive and it is minimized.
AndroidAndroid Widget This constant is not available.
exeInactiveThe program run is inactive: it is run while the current program keeps focus.
AndroidAndroid Widget This constant is not available.
exeMaximizeThe program run is active, it "takes control" over the current program (the execution window is maximized).
AndroidAndroid Widget This constant is not available.
Versions 27 and later
exeNoHandleInheritance
New in version 27
exeNoHandleInheritance
exeNoHandleInheritance
Indicates that the executable should not inherit handles from the parent (applies to ALL handles, including files). The executable is independent of the application that launched it.
This constant can be combined with other application launch constants.
AndroidAndroid Widget This constant is not available.
AndroidAndroid Widget 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:
exeDontWait
(Default value)
The current program and the launched program run in parallel.
exeWaitThe current program resumes its execution when the program run is over.
AndroidAndroid Widget 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.
AndroidAndroid Widget This parameter is not available.
Remarks

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.
Android If the program run was developed with WINDEV or WINDEV Mobile, you can get the command line using CommandLine.
Versions 25 and later
AndroidAndroid Widget

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.
Tips:
  • 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.
New in version 25
AndroidAndroid Widget

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.
Tips:
  • 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.
AndroidAndroid Widget

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.
Tips:
  • 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.
Component: wd270std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment