+
+#if TARGET_HOST_UNIX_X11
+
+ XResizeWindow( fgDisplay.Display, window->Window.Handle,
+ width, height );
+ XFlush( fgDisplay.Display ); /* XXX Shouldn't need this */
+
+#elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE
+
+#if !TARGET_HOST_WINCE
+ {
+ RECT winRect;
+ int x, y, w, h;
+
+ /*
+ * For windowed mode, get the current position of the
+ * window and resize taking the size of the frame
+ * decorations into account.
+ */
+
+ /* "GetWindowRect" returns the pixel coordinates of the outside of the window */
+ GetWindowRect( window->Window.Handle, &winRect );
+ x = winRect.left;
+ y = winRect.top;
+ w = width;
+ h = height;
+
+ if ( window->Parent == NULL )
+ {
+ if ( ! window->IsMenu && !window->State.IsGameMode )
+ {
+ w += GetSystemMetrics( SM_CXSIZEFRAME ) * 2;
+ h += GetSystemMetrics( SM_CYSIZEFRAME ) * 2 +
+ GetSystemMetrics( SM_CYCAPTION );
+ }
+ }
+ else
+ {
+ RECT parentRect;
+ GetWindowRect( window->Parent->Window.Handle, &parentRect );
+ x -= parentRect.left + GetSystemMetrics( SM_CXSIZEFRAME ) * 2;
+ y -= parentRect.top + GetSystemMetrics( SM_CYSIZEFRAME ) * 2 +
+ GetSystemMetrics( SM_CYCAPTION );
+ }
+
+ /*
+ * 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,
+ x, y, w, h,
+ SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSENDCHANGING |
+ SWP_NOZORDER
+ );
+ }
+#endif /* TARGET_HOST_WINCE */
+
+ /*
+ * 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 ) );
+ else