Forcing screen to be a certain size

How do I make it so the screen is non fullscreened (cannot be full screened) and is a certain size ratio (aspect ratio i think it is)? I tried tinkering with the player settings but with no results.

Through scripting, via Screen.SetResolution. However, width/height ignored when testing in the editor.

In order to get the Player Settings Width/Height values to work, after you already started a build: