Service install in XP
From: PrMon (nospam_at_nospam.com)
Date: 10/30/03
- Next message: Robby: "Folder file count"
- Previous message: Andrea Raimondi: "Retrieving an environment variable from another process context"
- Next in thread: Serguei: "Re: Service install in XP"
- Reply: Serguei: "Re: Service install in XP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 30 Oct 2003 16:14:11 +0200
I'm trying to install service programatically in WinXP.. So i wrote this
code, but it's not working.. What is the problem with this code ?
Regards,
procedure TForm1.Button1Click(Sender: TObject);
var
SCMHandle: THandle;
begin
SCMHandle := OpenSCManager('', '', SC_MANAGER_CREATE_SERVICE);
CreateService(SCMHandle,
PChar('MyGuard'),
PChar('MyGuard'),
SERVICE_ALL_ACCESS,
SERVICE_WIN32_OWN_PROCESS,
SERVICE_AUTO_START,
SERVICE_ERROR_NORMAL,
PChar( 'C:\Guard.exe'), '', nil, '', '', '');
CloseServiceHandle(SCMHandle);
end;
- Next message: Robby: "Folder file count"
- Previous message: Andrea Raimondi: "Retrieving an environment variable from another process context"
- Next in thread: Serguei: "Re: Service install in XP"
- Reply: Serguei: "Re: Service install in XP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]