PDA

View Full Version : Windows reboot will not gracefully shutdown FG



Milmoor
December 11th, 2020, 15:04
Sometimes Windows does a reboot without user interference. If FG is started while this happens, it will not gracefully shutdown. I will have yet another backup from the db.xml and get a warning while restarting FG. I assume Windows will announce a reboot to the running programs, so FG could altered to shutdown properly? Closing FG is rather fast, so that should not be an issue. I have FG running most of the time, so in the end, this happens quite a few times.

Zacchaeus
December 11th, 2020, 16:24
If FG is shut down in any way other than exiting the program then it will not have a chance to save the db file and so it will create the backup when it is restarted.

Milmoor
December 11th, 2020, 16:28
That is exactly the issue. It should exit if Windows decide to reboot. But writing this, I realize this should go on the wish list.

Weissrolf
December 11th, 2020, 16:30
But FG could preferably handle the system shutdown like most other software does. Windows announces the logoff and gives every software the opportunity to either gracefully shutdown or keep Windows from shutting down (like when a Save popup in Excel is still waiting for user interaction). For the latter the user is asked for a decision whether to cancel the shutdown or enforce it.


In Windows XP (2001), each running application is sent the WM_QUERYENDSESSION message at shutdown. Applications can return TRUE to indicate that they can be closed, or FALSE to indicate that they should not be closed (e.g., because doing so would cause the user to lose data or destroy a CD being burned). If an application returns FALSE, in most cases, shutdown will be cancelled (and the application that cancelled shutdown is sent WM_ENDSESSION with wParam == FALSE). Microsoft® guidance for applications that return FALSE is that they should display UI indicating why they needed to cancel shutdown.

Applications can also delay responding to WM_QUERYENDSESSION in order to display UI asking what the user would like to do. For example, when Notepad has unsaved data and displays a "Would you like to save your data?" dialog during shutdown, this is what it is doing.