hSCM := OpenSCManager(nil, SERVICES_ACTIVE_DATABASE, SC_MANAGER_CONNECT or SC_MANAGER_ENUMERATE_SERVICE or SC_MANAGER_QUERY_LOCK_STATUS or STANDARD_RIGHTS_READ);
GnuGettext, WinSvc, Windows, uTools, JclSvcCtrl, SysUtils;
TServiceStatus = (ssError, ssNotFound, ssUnknown, ssRunning, ssStopped);
TStartStopService = (ssStart, ssStop);
function GetServiceStatus(name: string): TServiceStatus;
function GetServicePath(name: string): string;
//function StartService(name: string): Integer;
//function StopService(name: string): Integer;
function GetServiceWithPid(const PID: DWORD): string;
// function StartStopService(name: string; StartStopService: TStartStopService):boolean;
SERVICE_WIN32_OWN_PROCESS = $00000010;
SERVICE_WIN32_SHARE_PROCESS = $00000020;
//function StartService(name: string): Integer;
// Manager: TJclSCManager;
// Service: TJclNTService;
// fMain.AddLog('service', Format(_('Searching for service %s'), [name]), ltDebug);
// Manager := TJclSCManager.Create;
// Manager.Refresh(True);
// if Manager.FindService(name, Service) then
// fMain.AddLog('service', _('Found service, attempting to start'), ltDebug);
// Result := Service.Win32ExitCode;
// fMain.AddLog('service', Format(_('Return Code %d'), [Result]), ltDebug);