I have a program that runs some code when you close it down.  Basically
to tell the server that it is shut down properly.

I also want this code to run if the user logs off or shuts down the PC
without closing down the program.

I am having heaps of trouble getting this to work.  I have searched the
internet and found a couple of ways of doing this but none actually seem
to work for me.

1. use the OnCloseQuery on the main form.

Using this I can actually stop windows closing down (yay) but if I put
code in here it doesn't seem to run before shutting the computer down.

2. Capture the WMQueryEndSession message from windows

Seems to either 
a : Run the tidy up code and stop windows from shutting down
or
b: Let windows shut down but don't run the code

Does anyone have any pointers on this?  Any ideas what I might be doing
wrong.  The program runs over a sockets connection using midas... All I
am trying to do is run a couple or queries (search for a record - then
update this record)

Steve

_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to