ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Service 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
ServiceWaitStatus (Function)
In french: ServiceAttendEtat
Waits for a service to be in a specific status. This service can be found on the local computer or on a remote computer.
// Wait for the service in TABLE_Service to start
Res is int
ServiceStart(COL_Name[TABLE_Service])
Res = ServiceWaitStatus(COL_Name[TABLE_Service], serviceStatusStarted, 10)
IF Res = -1 THEN
Error(ErrorInfo())
ELSE
Info("Status at the end of timeout: " + StatusInText(Res))
END
Syntax
<Result> = ServiceWaitStatus(<Service name> , <Expected status> [, <Timeout> [, <Remote computer>]])
<Result>: Integer constant
  • Current status of the service,
    serviceStatusPausedThe service is paused.
    serviceStatusPausingThe service received a command to pause but it has not been paused yet.
    serviceStatusRestartingThe service received a command to restart but it has not been restarted yet.
    serviceStatusStartedThe service is currently operating.
    serviceStatusStartingThe service received a command to start but it has not been started yet.
    serviceStatusStoppedThe service is stopped.
    serviceStatusStoppingThe service received a command to stop but it has not been stopped yet.
    serviceStatusTimeoutThe service has not reached the requested status at the end of the timeout.
  • -1 if an error occurred. To get more details on the error, use ErrorInfo.
<Service name>: Character string
Name of the service to use.
<Expected status>: Integer constant
Expected status of the service:
serviceStatusPausedThe service is paused.
serviceStatusPausingThe service received a command to pause but it has not been paused yet.
serviceStatusRestartingThe service received a command to restart but it has not been restarted yet.
serviceStatusStartedThe service is currently operating.
serviceStatusStartingThe service received a command to start but it has not been started yet.
serviceStatusStoppedThe service is stopped.
serviceStatusStoppingThe service received a command to stop but it has not been stopped yet.
<Timeout>: Optional integer or optional Duration
Maximum timeout (in seconds). This parameter can be:
  • an integer corresponding to the number of seconds,
  • a Duration variable,
  • the duration in a readable format (e.g., 1 s).
If this parameter is not specified or is set to -1, there will be no timeout.
<Remote computer>: Optional character string
  • IP address of the remote computer in xxx.xxx.xxx.xxx format (returned by NetIPAddress),
  • Name of the remote computer (returned by NetMachineName).
This parameter is used to handle a service on another computer. To use this option, the user must be administrator of remote computer.
If this parameter is not specified or if it corresponds to an empty string (""), the service is handled locally.
Component: wd290std.dll
Minimum version required
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 01/09/2024

Send a report | Local help