Windows maximized

Is it possible to start an app (standalone PC Unity app) with a maximized window? The default resolution I put int the player is not exactly what I'm looking for: a window that expands in the whole available desktop working area (1 monitor) without interfering with the windows task bar.

If you want to maximize your standalone unity app running in Window Mode, you can do so by using Screen.currentResolution to get the current desktop resolution.

You can then use SetResolution with the desktop resolution, BUT you need to reduce the arguments width and height to give room for the Window borders.

My guess is that SetResolution was designed for fullscreen and it doesn’t really do the job for when you need to change the Window size in Window Mode. SetResolution changes the client area e.g. rendered viewport within the Window.
It seems that if SetResolution results in a window greater than the desktop resolution then Unity shrinks the window.

The workaround is to take your desired window size and subtract it with the current window border size.

In C# you can use the native method calls GetWindowRect and GetClientRect to calculate the border sizes.

It looks like fullscreen mode. To run unity in window mode you can change player settings in Edit->Project Settings->Player and set “Default Is Full Screen” property to false.
Also you can change it programmatically by using Screen class.

It is possible, but not natively with Unity.

Here is a script that maximize your game window on startup. It only works on Windows and you just need to place the script in your project. You need to replace “APP_NAME” by a regex that matches your Application.productName.

Use these settings for your player settings:
alt text