last open window on quit

Is there a straight-forward way to save the last window the user had open when he quit the app - so that it can be automatically reopened the next time the app starts?

Seems fairly easy to save the name of the window in a file or database within a subfolder of Specialfolder.ApplicationData.

Then when the app starts it can check for the presence of the saved data and open that window.

If on top of it you need the window to come back with the same content, you will have to save and reload that too.