Rohit,
I think it depends on what your service is doing.
If you have a GUI window as part of your service, then yes.. you can
respond to WM_QUERYENDSESSION and WM_ENDSESSION.
In the services that I have written in Delphi, I often have a tray icon
that is owned by a window (in this case a Delphi Form), and I get the form
to respond to the messages like this:
procedure TMyForm.QueryEndSession(var Msg: TMessage);
begin
Msg.Result := 1;
end;
procedure TMyForm.EndSession(var Msg: TMessage);
begin
if IsService then
RemoveIcon
else
begin
fClosing := true;
close;
end;
end;
But you must bear in mind here that these forms are designed so that they
fit into apps which can run either as apps or as services.
Also, if you are running an app as a service, there are some tricks to stop
the thing from shutting down when a user logs off, and to put the tray icon
back when a new user logs on. Unfortunately I haven't figured out how to
put the tray icon into XP type terminal sessions other than the default.
Does this help at all?
Trevor
P.S.
Glad to hear that your Firebird/IBO problem was finally sorted out.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Rohit Gupta
Sent: Friday, 24 September 2004 1:40 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: [DUG] Service - windows shutdown
Does anyone know if it is possible for a service to respond to a
wmQuerySession message. I need for it to shut down things a lot
earlier.Regards
Rohit
====================================================
==================
CFL - Computer Fanatics Ltd. 21 Barry's Point Road, AKL, New
Zealand
PH (649) 489-2280
FX (649) 489-2290
email [EMAIL PROTECTED] or [EMAIL PROTECTED]
====================================================
==================
_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi