Thanks a lot ! It's working.
Just another question : do you know what are code status for daemons ?

For example : CurrentStatus = 1 => daemon stopped, CurrentStatus = 4 =>
daemon started.


2007/7/26, Michael Van Canneyt <[EMAIL PROTECTED]>:



On Thu, 26 Jul 2007, fvpats wrote:

> Sorry but i have nothing in log viewer. I should see something like
"Daemon
> start" no ?
> But this demo program don't answer my problem. My problem is how to
check if
> Apache service is installed, its status, how to install, change its
starting
> mode (manual, automatic), ...

For this you need the servicemanager unit.

Do something like:

Var
  SM : TServiceManager;
  SE : TServiceEntry;

begin
  SM:=TServiceManager.Create(Nil);
  SM.RefreshOnConnect:=True;
  SM.Connect;
  For I:=0 to SM.Services.Count-1 do
    begin
    SE:=SM.Services[i];
    Writeln(SE.Name,' : ',SE.CurrentState);
    end;
  SM.Free;
end;

Michael.

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to