+ /*
+ * For windowed mode, get the current position of the
+ * window and resize taking the size of the frame
+ * decorations into account.
+ */
+
+ GetWindowRect( window->Window.Handle, &rect );
+ rect.right = rect.left + width;
+ rect.bottom = rect.top + height;
+
+ if ( window->Parent == NULL )
+ {
+ if ( ! window->IsMenu && !window->State.IsGameMode )
+ {
+ rect.right += GetSystemMetrics( SM_CXSIZEFRAME ) * 2;
+ rect.bottom += GetSystemMetrics( SM_CYSIZEFRAME ) * 2 +
+ GetSystemMetrics( SM_CYCAPTION );
+ }
+ }
+ else
+ {
+ GetWindowRect( window->Parent->Window.Handle, &rect );
+ AdjustWindowRect ( &rect, WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS |
+ WS_CLIPCHILDREN, FALSE );
+ }
+
+ /*
+ * SWP_NOACTIVATE Do not activate the window
+ * SWP_NOOWNERZORDER Do not change position in z-order
+ * SWP_NOSENDCHANGING Supress WM_WINDOWPOSCHANGING message
+ * SWP_NOZORDER Retains the current Z order (ignore 2nd param)
+ */
+
+ SetWindowPos( window->Window.Handle,
+ HWND_TOP,
+ rect.left,
+ rect.top,
+ rect.right - rect.left,
+ rect.bottom - rect.top,
+ SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSENDCHANGING |
+ SWP_NOZORDER
+ );
+ }
+
+ /*
+ * XXX Should update {window->State.OldWidth, window->State.OldHeight}
+ * XXX to keep in lockstep with UNIX_X11 code.
+ */
+ if( FETCH_WCB( *window, Reshape ) )
+ INVOKE_WCB( *window, Reshape, ( width, height ) );