Please save and restore the window position


If you play in windowed mode, you should NOT have to move the window to where you want it every single time you run the game.

Just save and restore the window position in between sessions.

Here is the code:
Upon closing the game:

// Retrieve the X,Y origin of the window
WINDOWPLACEMENT	windowPlacement;
memset( &windowPlacement, 0, sizeof(windowPlacement) );
windowPlacement.length = sizeof(WINDOWPLACEMENT);
GetWindowPlacement( hwnd, &windowPlacement );

// Store the current X,Y origin
x = windowPlacement.rcNormalPosition.left;
y =;

Then all you have to do it store that x and y, and use them when you create the game window when the game is started (aka same place where you use the stored width and height).

And I’m sure it’s even easier in unity, as saving and restoring the window position is pretty much common behaviour in all games.


And here is actual Unity code that does this.

@Sirrian @Nimhain