ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Executable functions
  • Use in service mode
  • Running an APK file setup
  • Background application: Specific to Android 10 and higher
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Opens a document in its associated application. The application is opened first, then the specified document.
Remarks:
  • The application used to open the document is the one associated with the extension of the document in Windows (INI file or registry). This associated application may differ according to the configurations used.
  • WEBDEV - Server code This document is opened on the server. This function can be used on the development computer because this compute is considered as being the server.
  • WEBDEV - Browser code This document must be found on the server or at any Internet address. This document is opened on the computer of the Web user.
  • Android The application used to open the document is the application corresponding to the MIME type associated with the file extension. If several applications correspond to the same type of file, a dialog box will be displayed to select the application to start.
  • iPhone/iPadIOS Widget The ShellExecute function is blocking: the application will continue to run only when the document and its associated application are closed.. The document must be on the computer.
  • To display any page in a browser, you can also use BrowserRunApp.
Example
WINDEVWEBDEV - Server codeWEBDEV - Browser codeReports and QueriesUser code (UMC)Ajax
// Open the "Functions.doc" document in Word
ShellExecute("C:\WDNEWS\Version\Functions.doc")
// Print the document
ShellExecute("C:\WDNEWS\Version\Functions.doc", "print")
WINDEVReports and QueriesUser code (UMC)
// Open a site in the default browser
ShellExecute("http://www.windev.com")
WINDEVReports and QueriesUser code (UMC)
// Start the default messaging
ShellExecute("mailto:pcsoft@windev.com")
// Start the messaging with parameters 
// Parameters recognized by Outlook
ShellExecute("mailto:pcsoft@windev.com" + ...
	"?subject=Subject: LST &body=Text: LST summary")
WINDEVReports and QueriesUser code (UMC)
// Open the "Invoice.doc" document from its shortcut
ShellExecute("""C:\Documents and Settings\Julia\Desktop\Shortcut to Invoice.doc.lnk""")
WEBDEV - Browser code
// Open a site in the current browser
ShellExecute("http://www.windev.com")
Syntax
<Result> = ShellExecute(<File name> [, <Verb>])
<Result>: Boolean
  • if the document exists and if the associated application has been launched.
  • False otherwise.
WEBDEV - Browser codePHP This parameter is not available. This function returns no result.
Java Returns False if the application is run with a Java virtual machine (JRE) earlier than version 1.6.
<File name>: Character string
Name and full (or relative) path of the document to open. A UNC path can be used.
If space characters are found in the name or path of the document to open, the quotes found around this parameter must be tripled.
WINDEV This parameter can also correspond to a Windows shortcut.
AndroidAndroid Widget This parameter can correspond to a full path, to a relative path or to a URI.
For example:
  • "/sdcard/photo.png"
  • "/sdcard/video.3gp".
  • "http://www.pcsoft.fr": launches the Web browser on the specified page.
  • "geo:1.44951,43.604363": launches Google Maps or equivalent.
  • "mailto:pcsoft@pcsoft.fr" starts the application for sending emails.
  • "sms:0612345678": launches the SMS sending application.
The files found in the application directory (or in one of its sub-directories) are not accessible by most of the external applications. It is advisable to use the ShellExecute function with files located on the device's external memory (e.g. sdcard), as they are accessible from all applications.
<Verb>: Optional character string
Verb that must be used to start the document. The verbs are defined for each application, to indicate the actions that can be performed. The most common verbs are open or print. If this parameter is not specified, the verb used will be the default verb for the type of document.
WEBDEV - Browser codeAndroidAndroid Widget iPhone/iPadIOS WidgetJavaPHP This parameter is not available.
Remarks

Use in service mode

When ShellExecute is used in service mode, it runs the associated application but the interface of this application is not visible.
Android

Running an APK file setup

From Android 8, to run the setup of an APK file with ShellExecute, it is necessary to modify the permissions required by the application.
Permission required: REQUEST_INSTALL_PACKAGES.
This permission is used to install packages.
AndroidAndroid Widget

Background application: Specific to Android 10 and higher

Starting with Android 10, it is no longer possible to open a window when the application is in the background.
ShellExecute 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.
Business / UI classification: Neutral code
Component: wd300std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/30/2024

Send a report | Local help