Could I please get an example of this?  I see lots of examples of how to do it 
in C but when I try to translate to pascal I always struggle a quite a bit.

 

James

 

From: fpc-pascal <[email protected]> On Behalf Of Henry 
Vermaak
Sent: Sunday, May 19, 2019 8:39 AM
To: FPC-Pascal users discussions <[email protected]>
Subject: Re: [fpc-pascal] Detecting console close with red X on windows

 

On Sun, 19 May 2019, 13:23 James Richters, <[email protected] 
<mailto:[email protected]> > wrote:

Is there a way I can detect that a user has pushed the red X in the upper right 
corner to close the console window in a free pascal console application so I 
can save some files before the program terminates?

You can do that with SetConsoleCtrlHandler() and catching  CTRL_CLOSE_EVENT in 
the handler.

 

Henry

_______________________________________________
fpc-pascal maillist  -  [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to