Thanks a lot !
It's OK

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



On Thu, 26 Jul 2007, fvpats wrote:

> 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.

You can use these functions for display purposes:

Function ServiceTypeToString(AType : Dword) : String;M
Function ServiceStateToString(AState : DWord) : String;M
Function ControlsAcceptedToString(AValue : DWord) : String;M
Function IsInteractiveService(AType : Dword) : Boolean;M

There are some  constants in the servicemanager unit,
and their explanation is in the windows unit.

Michael.

>
>
> 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
> >
>

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

Reply via email to