I have a Windows Forms application that when the Main Window is closing, it displays a basic dialog box, confirming the action. If the user decides to cancel the application exit is cancelled.
However, when the application is running minimized and the user wants to shut down the PC, the shutdown sequence stops because my application is waiting on the user to confirm the application close (the dialog box is displayed).
I thought of adding a timer for making a timeout and if no answer comes in a certain amount of time, close the application automatically, but even if this is a way to do it, it's certainly NOT how every other app does it.
So what would there be an optimal solution to confirm the application shutdown in every other case, unless the system is shutting down?
Thank you!