Did you see if that code does what you want?
Also - I quite dislike unmaximizable windows personally. I even play Minecraft and my favorite Flash games (via standalone Flash player on Windows) as a maximized window (Minecraft is 3D and stretches and Flash games seem to fill entire view or letterbox nicely with black bars on sides or top and bottom, depending on the game). I much prefer if game can stretch its view or letterbox it even if I get blackbars - I prefer that to seeing parts of desktop and other windows behind the game or being forced into fullscreen (in which case the window has to adjust still since screens vary a lot).