Force aspect ratio of window (standalone Windows)

Hi,

I am designing an application that is supposed to run exclusively in a 1:1 window. No fullscreen, no different aspect ratio.

I have been searching high and low for the following but cannot seem to find it out:

1/ How do I prevent ALT+Enter from switching to fullscreen?

2/ How do I force the aspect ratio of the window, when the window is resized by the user?

My player options are set so that fullscreen is disabled by default, the window resolution is 800x800 and the window is resizable. I cannot see any built-in option for any of the problems above.

I am guessing (and hoping) it is possible to script a solution (in the window resize event, force the ratio?) but I cannot figure it out.

Is that possible?

Thanks!

You could try something like this:

    void Start()
{
	Screen.SetResolution (800, 800, false);
}
void Update()
{
	if (Screen.fullScreen || Camera.main.aspect != 1) 
	{
		Screen.SetResolution (800, 800, false);
	}
}

This is just a start as it will flicker when switching to full mode, but that could get you starting.