[Lazarus] Stopping a service from within a service

Richard Mace richard.mace at gmail.com
Fri Feb 5 15:27:38 CET 2016


That works great thanks :)
On 4 Feb 2016 22:53, "Jy V" <jyv110 at gmail.com> wrote:

> On Thu, Feb 4, 2016 at 8:57 PM, Richard Mace <richard.mace at gmail.com>
> wrote:
>
>> On 4 February 2016 at 17:39, Jy V <jyv110 at gmail.com> wrote:
>>
>>> On Thu, Feb 4, 2016 at 5:41 PM, Richard Mace <richard.mace at gmail.com>
>>> wrote:
>>> XMLRAD stop a program registered as a service running following code,
>>>
>>
>> ​So, would I run this code by creating a TProcess from within my service,
>> to get it to "stop" my service?
>>
>
> if you have the SvcHandle available inside your program since you are the
> very own running service,
> you can even skip OpenSCManagerA and OpenServiceA and stop the process
> directly
> calling ControlService(SvcHandle, SERVICE_CONTROL_STOP, Status)
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160205/0fa41e61/attachment-0003.html>


More information about the Lazarus mailing list