Haven't you considered that if you add scrollbars, a toolbar, and other elements to the game window, which are present in any window, the resolution will already be larger than the screen resolution. And how do you want to fit it if it doesn't fit? Naturally, the game will crash.