Group: Service - Library: advapi32
Encapsulating access to the Windows Services in a class
How to delete a service object
BOOL ControlService(
SC_HANDLE hService,
DWORD dwControl,
LPSERVICE_STATUS lpServiceStatus
);
DECLARE INTEGER ControlService IN advapi32;
INTEGER hService,;
LONG dwControl,;
STRING @ lpServiceStatus
hService [in] Handle to the service. This handle is returned by the OpenService or CreateService function.
dwControl [in] This parameter can be one of predefined control codes.
lpServiceStatus [out] Pointer to a SERVICE_STATUS structure that receives the latest service status information.
If the function succeeds, the return value is nonzero.
The ControlService function asks the Service Control Manager (SCM) to send the requested control code to the service. The SCM sends the code if the service has specified that it will accept the code, and is in a state in which a control code can be sent to it.
See also: OpenService, StartService.