Re: [fpc-pascal] Detecting console close with red X on windows

2019-05-19 Thread James Richters
Thanks for clarifying, I have everything working well now in my real program, I didn’t need to do anything other than save and close some files, so I have plenty of time to get everything done. James From: fpc-pascal On Behalf Of Sven Barth via fpc-pascal Sent: Sunday, May 19, 2019

Re: [fpc-pascal] Detecting console close with red X on windows

2019-05-19 Thread Sven Barth via fpc-pascal
James Richters schrieb am So., 19. Mai 2019, 19:10: > Thanks!That was quite helpful! I have a test program kind of > working. > > I notice I only get 5 seconds to do what I am going to before it closes, > and I also notice that my program can no longer respond to keystrokes after > I hit

Re: [fpc-pascal] Detecting console close with red X on windows

2019-05-19 Thread James Richters
Thanks!That was quite helpful! I have a test program kind of working. I notice I only get 5 seconds to do what I am going to before it closes, and I also notice that my program can no longer respond to keystrokes after I hit the red X.How do other programs get around this? For

Re: [fpc-pascal] Detecting console close with red X on windows

2019-05-19 Thread Henry Vermaak
On Sun, 19 May 2019 at 14:33, James Richters wrote: > > 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. Have a look at the fpc source in packages/fv/src/w32msg.inc and search for

Re: [fpc-pascal] Detecting console close with red X on windows

2019-05-19 Thread Henry Vermaak
On Sun, 19 May 2019, 13:23 James Richters, 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

Re: [fpc-pascal] Detecting console close with red X on windows

2019-05-19 Thread wkitty42
On 5/19/19 8:29 AM, Kevin Lyda wrote: At least on Unix systems I'd assume the answer was to write a signal handler: https://www.freepascal.org/docs-html/rtl/baseunix/fpsigaction.html IME, that should always be done... especially in the *nix world... you never know where termination may come

Re: [fpc-pascal] Detecting console close with red X on windows

2019-05-19 Thread Kevin Lyda
At least on Unix systems I'd assume the answer was to write a signal handler: https://www.freepascal.org/docs-html/rtl/baseunix/fpsigaction.html Kevin On Sun, May 19, 2019 at 1:23 PM James Richters wrote: > > Is there a way I can detect that a user has pushed the red X in the upper > right

[fpc-pascal] Detecting console close with red X on windows

2019-05-19 Thread James Richters
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? James ___ fpc-pascal maillist -