K
kiths
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TSupervise.MyInstallService;
var Svc,error_code: Integer;
hSCM: SC_HANDLE;
sFileName:String;
begin
sFileName:=ParamStr(0);
hSCM:= OpenSCManager(nil, nil, SC_MANAGER_CREATE_SERVICE);
if hSCM=0 then exit;
Svc := CreateService(hSCM,
'Test',
'Test',
SERVICE_ALL_ACCESS,
$00000110,
SERVICE_AUTO_START,
SERVICE_ERROR_NORMAL,
PChar(sFileName),
nil,
nil,
nil,
nil,
nil);
if Svc = 0 then
RaiseLastOSError;
CloseServiceHandle(Svc);
CloseServiceHandle(hSCM);
var Svc,error_code: Integer;
hSCM: SC_HANDLE;
sFileName:String;
begin
sFileName:=ParamStr(0);
hSCM:= OpenSCManager(nil, nil, SC_MANAGER_CREATE_SERVICE);
if hSCM=0 then exit;
Svc := CreateService(hSCM,
'Test',
'Test',
SERVICE_ALL_ACCESS,
$00000110,
SERVICE_AUTO_START,
SERVICE_ERROR_NORMAL,
PChar(sFileName),
nil,
nil,
nil,
nil,
nil);
if Svc = 0 then
RaiseLastOSError;
CloseServiceHandle(Svc);
CloseServiceHandle(hSCM);