Properties:
- AutoUpdate (r/w). If this property is
True (nonzero), when you tell the service to change its state (stop it, start
it, pause it...) the library will start checking for the state of
the service till its state changes completely or till the time specified
in AutoUpdateTimeOut expires. This is because usually a service
doesn't change its state immediately, but needs some time for processing.
Therefore, before when you changed the state of a service, the CurrentState
property passed to something like 'Start Pending', and after that
you had to refresh the state manually. This property is automatically
True if you are using this class independently, and automatically
False if you are accessing from a clsServices class.
- AutoUpdateInterval (r/w). How often the
library will refresh the status of the service, given in milliseconds.
- AutoUpdateTimeOut (r/w). If the service
doesn't change its status, for how long the library should keep refreshing its contents,
in milliseconds.
- BinaryPathName (r/w). Path to the binary file of the
service.
- CheckPoint.
- ComputerName (r/w). By default, this
property is empty if you are using this class independently, or has the same value as the
class clsServices is this class is an item of the other. You can specify another name to
access a service in another computer.
- ControlsAccepted (r-o).
Possible values are: Accept Pause & Continue, Accept Shutdown or Accept Stop. Also, it
could be any combination of these values. To know if a service accepts a certain control,
use operator &. Example: if(Svc.ControlsAccepted&Accept_Stop_20).
- CurrentState (r/w). Possible
values are: Continue Pending, Pause Pending, Paused, Running, Start Pending, Stop Pending
or Stopped. You can also set this property to Start, Stop or Pause to modify the state of
the service.
- Dependencies (r/w). This
property will return an object that contains the dependencies of the service, if any. You
can also create this class independently and set it to this property to change the
dependencies of the service.
- DisplayName (r/w). Display name for the
service (those you can see in the services control manager). If you change this property,
the class will look for another service that has that display name, and if it finds it, it
will update itself with the information of that service.
- LoadOrderGroup (r/w).
- Name (r/w). Internal name of the service.
You can change this property to the name of other service, and the class will update
itself with the configuration of that service.
- Password (r/w). You can use this property
to change the password of the account under which a service is run. If you do it, this
property will also contain that password if the change is successful. If it is not, or you
haven't changed the password, this property will be empty (what doesn't mean that the
account doesn't have any password).
- ServiceSpecificExitCode (r-o).
- ServiceType (r/w). Possible values
are: File System Driver, Kernel Driver, WIN32 Own Process, WIN32 Share Process,
Interactive WIN32 Own Process or Interactive WIN32 Share Process.
- StartErrorSeverity (r/w).
Possible values are: Ignore Error, Normal Error, Severe Error ore Critical Error. Informs
on how there server will act if an error ocurres at startup.
- StartName (r/w). Depending on the type of service,
this can be the name of the account under which the service is running.
- StartType (r/w). Possible values are:
Auto Start, Boot Start, Demand Start, Disabled, System Start. Indicates how the service is
started.
- TagID (r/w).
- WaitHint (r-o).
- Win32ExitCode (r-o).
|
Methods:
- ChangeAccount(strUserID, strPassword, [strDomain]). If you want to change the account under which a
WIN32_OWN_Process service is run, you can't use the StartName and Password properties
independently, since both must be changed at the same time. Use this method instead.
- ChangeDisplayName(strDisplayName). You can't use the DisplayName property because if you change it, the class will
just look for another service with that display name, instead of changing that property
for the current service. Use this method instead.
- ContinueService. Use this method to
continue the service if it is paused. Returns True of successful or False if an error
ocurred.
- PauseService.Use this method to pause a
service if it is running. Returns True of successful or False if an error ocurred.
- StartService. Use this method to start a
service if it is stopped. Returns True of successful or False if an error ocurred.
- StopService. Use this method to stop a
service if it is running. Returns True of successful or False if an error ocurred.
- Refresh. Forces the library to update the information
about the service. Returns True of successful or False if an error ocurred.
|