From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,53d6d1308be499e1,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-21 15:02:04 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!77144-cm.able.ES!not-for-mail From: Jano Newsgroups: comp.lang.ada Subject: Gracefully detecting program termination. Date: Wed, 22 Oct 2003 00:02:01 +0200 Message-ID: NNTP-Posting-Host: 77144-cm.able.es (212.97.177.144) X-Trace: news.uni-berlin.de 1066773722 29592261 212.97.177.144 (16 [49872]) X-Newsreader: MicroPlanet Gravity v2.50 Xref: archiver1.google.com comp.lang.ada:1334 Date: 2003-10-22T00:02:01+02:00 List-Id: Hello fellow Adagoers, I have a program that runs under Win32 and Linux. It's a daemon-like tool, so it is launched on startup and runs until system goes down. Now I'm interested in it detecting when the shutdown is happening to save some data and do a graceful ending. In Linux I think it suffices to trap SIGTERM and company. In Windows I've seen that I could catch Ctrl-C that way but not a system shutdown. I'm still in the process of investigating it so I haven't still reached a dead end, but just in case someone is doing this already and can throw me a quick pointer in the way to go... Thanks!