They are probably responding to the WM_CLOSE message that NT dispatches to
all windows on the desktop.  Try running them without user interaction.

Regards,
Dennis.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Jeremy Coulter
Sent: Tuesday, 28 March 2000 14:44
To: Multiple recipients of list delphi
Subject: [DUG]: NT Services


Hi all
We have a couple apps that were written in Delphi 3 that were notoriginally
written to serve as an NT service, but it was later decided
that they should be. I have adapted them so that if they are run with
the right command line argument they will call SetServiceStatus and
StartServiceCtrlDispatcher. The intent of that is so that when the
system tries to start the executable it will use the command line
argument and the exe will know how to start itself. They work well and
support starting and stopping from Control Panel\Services and they do
startup when the machine boots if they are set to automatic startup. But
if the user logs in, and then selects "Close all programs and log in as
a different user" the apps stop. I am logging all the messages such as
SERVICE_CONTROL_INTERROGATE and SERVICE_CONTROL_STOP and they do not
appear to be getting any messages indicating that the service is
stopped. As far as I can tell, the problem is that NT closes the app as
if it were a regular program and not a service.

Jeremy Coulter (Software Manager)
Triton Commercial Systems Ltd
6a Burdale Street
Christcurch
Phone +64 3 3483973
Fax   +64 3 3431613
Cell   021 2533214

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to