by Mayhew » Fri Oct 10, 2014 2:16 pm
It is different for each platform
On Win if you are using straight win32 APIS you can use GetWindowPlacement and/or GetWindowRect in your apps WM_DESTROY handler and store the values in the registry. On launch when you call CreateWindow() to create your new main window you can read those reg entries and call SetWindowPlacement() to restore the position
On Mac, assuming you are a Cocoa app, the OS can just handle this for you. Check out the setFrameAutosaveName API.
On Linux, it depends on your UI framework. For GTK its a similar procedure to Win. In your configure-event signal handler you can call gtk_window_get_position and gtk_window_get_size to get the new position and store it somewhere like your apps preferences. To restore it on launch, you can retrieve them after you create your main window in your main() method and use gtk_window_resize and gtk_window_move to restore the position and size.
I hope that helps.