I\'m writing what boils down to a document editor. When the application is closing, I need to prompt the user to save changes. This is easy enough. My question is when is it
I personally prefer to just close the program when the user selects close, if there are any unsaved documents at close time I prefer to keep backup copies of those files and inform the user that there are unsaved documents when they next open the application.
I do this for a couple of reasons, number one I like my applications to close when I tell them to close, and number two by keeping a temporary copy of the file that I update with all the changes as the user works on it I safeguard against unexpected crashes and closes of my applications.
So with this technique you don't need to worry about ow the application has been closed.