[Lazarus] Configure Build Lazarus, round 2

Juha Manninen juha.manninen at phnet.fi
Mon Dec 21 16:14:00 CET 2009


2009/12/21 Chris Jennings <cjvanbc at gmail.com>:
>--8<--
>
> 1. User opens my program and begins to interact with the data behind the
> program.
> 2. User initiates a system shutdown or logoff without closing my program.
> 3. The system must transfer control to my program that will at this point
> bring up a dialog suggesting that the user save any changes and close the
> program.
> 4. Upon doing #3, the system then continues with shutdown or will acept a
> new shutdown command.
>
> I know that this can be accomplished but have now idea where to start.

Well, for unix systems (or linux, at least) the program will receive a
sigterm signal when the system is shutting down.  You can catch this
signal and do some last minute emergency stuff, but you can't stop the
system from shutting down (at least as far as I know).

For example, if you're using vi and you kill it, the next time you try
and edit one of the files that were open it will ask you if you'd like
to recover (since it sees a tmp file).

Henry




More information about the Lazarus mailing list