ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Executable functions
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
Allows you to find out whether a 32-bit application is already run.
Remarks:
  • If the executable is compiled in 64 bits, the function returns the status of a 64-bit process.
  • If the executable is compiled in 32 bits, the function returns the status of a 32-bit process even if a 64-bit Windows is run.
WEBDEV - Server code This function is used to find out whether an executable is run on the server. Caution: the rights to handle this executable will be the ones of the current Internet user.
Example
WINDEVReports and QueriesUser code (UMC)
NbRun is int
NbRun = ExeRunning("C:\WINDEV\Programs\WINDEV.EXE")
IF NbRun > 0 THEN
Info("You are using WINDEV!")
END
Syntax

Finding out whether the specified executable is run Hide the details

<Result> = ExeRunning([<Executable name> [, <Option>]])
<Result>: Integer
  • Number of instances of the executable currently run.
  • 0 if the application is not started.
  • -1 if a problem occurred. For example:
    • The user has no sufficient rights to list the processes in memory.
    • The application could not access the system DLL used to enumerate the processes.
<Executable name>: Optional character string
Name and full path of executable (up to 260 characters). In this case, <Result> returns the instances of this specific application.
Name of the executable (up to 260 characters). In this case, <Result> is the number of instances of the program (regardless of its initial path).
If this parameter is not specified, the current executable is used.
Caution: The executable must be a 32-bit application.
<Option>: Integer constant
Allows you to specify the type of instances to be counted:
sysAllUsersCounts the instances of the executable launched by all users.
sysCurrentUserCounts the instances of the executable launched by the current user.
Caution: If the process that calls ExeRunning was started by the user and involves an elevation of privileges, this constant is equivalent to the sysAllUsers constant.

Finding out whether the specified PID is run Hide the details

<Result> = ExeRunning(<Executable PID>)
<Result>: Integer
  • 1 if the application is started.
  • 0 if the application is not started.
<Executable PID>: Integer
PID (Process Identifier) of the executable.
Component: wd290std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Video Exemplo ExeRun
https://youtu.be/_MqM-jTn3XQ
amarildo
26 Oct. 2018
Verificar se Este programa está Aberto
Verificar se Este programa está Aberto

//Verificar se Este programa está Aberto
IF ExeRunning(ExeInfo(exeName))>1 THEN
Info("Este Programa já está aberto ")
EndProgram(True) // Fechar Programa
END
//Verificar se o programa uninfe.exe está aberto
n_executa is int=0
n_executa=ExeRunning("E:\_2014_SSD\Programas\UniNFe\uninfe.exe")
IF n_executa>0 THEN
Info("Uninfe já Aberto")
ELSE
Info("Uninfe não aberto - vou abrir")
ExeRun("E:\_2014_SSD\Programas\UniNFe\uninfe.exe")
END

//Blog Com Video e Exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/08/curso-windev-funcoes-exe-windows-008.html
https://www.youtube.com/watch?v=qPyq9sXmRkE
De matos AMARILDO
13 Aug. 2016

Last update: 09/11/2023

Send a report | Local help