Group: Service - Library: advapi32
Encapsulating access to the Windows Services in a class
How to delete a service object
SC_HANDLE OpenService(
SC_HANDLE hSCManager,
LPCTSTR lpServiceName,
DWORD dwDesiredAccess
);
DECLARE INTEGER OpenService IN advapi32;
INTEGER hSCManager,;
STRING lpServiceName,;
LONG dwDesiredAccess
hSCManager [in] Handle to the service control manager database. The OpenSCManager function returns this handle.
lpServiceName [in] Pointer to a null-terminated string that specifies the name of the service to open.
dwDesiredAccess [in] Access to the service.
If the function succeeds, the return value is a handle to the service.
Unicode: Implemented as OpenServiceW (Unicode) and OpenServiceA (ANSI).
The returned handle is only valid for the process that called OpenService. It can be closed by calling the CloseServiceHandle function.
See also: StartService, ControlService.
Home