I rarely maximize, I want windows to change and change until they were in the last editing session. This should be recorded for each file (not one record of the last application editing session).
In my applications, I create a settings file in which I record the window position, size and (depending on the application), position in the file or the last input field / control or other information to restore the editing context.
This should be written separately for each user (the position should not be written to the file, because if the file is used by another user or edited in a different context, the other user can move the window to an undesirable position), so for Windows I put this in the local folder user settings (DO NOT put it in the registry), for UNIX I put this in the ~ home / .app directory. I usually have one file for each application (so that the application can easily find its position settings) with one entry for each file (or editing session). I would definitely not use XML for this (I will use plain formatted text or a binary file).
The user should be able to easily clear / reset all and / or the least recently available window positions in the window (for example, in the menu of tools / parameters / application settings). Also, do not forget to handle the case when the window is off-screen (for example, the desktop is changed or is on a disabled monitor), you may need to move the window back to the desktop.
source share