- /* store current window rect */
- GetWindowRect( win->Window.Handle, &win->State.pWState.OldRect );
+ /* save current window rect, style, exstyle and maximized state */
+ win->State.pWState.OldMaximized = !!IsZoomed(win->Window.Handle);
+ if (win->State.pWState.OldMaximized)
+ /* We force the window into restored mode before going
+ * fullscreen because Windows doesn't seem to hide the
+ * taskbar if the window is in the maximized state.
+ */
+ SendMessage(win->Window.Handle, WM_SYSCOMMAND, SC_RESTORE, 0);