[PATCH 6/14] user32: Send the WM_GETMINMAXINFO message from user32's CreateWindow

Pierre d'Herbemont pdherbemont at free.fr
Sun Jan 21 17:35:51 CST 2007


---
   dlls/user32/win.c         |   15 +++++++++++++++
   dlls/winex11.drv/window.c |   15 ---------------
   2 files changed, 15 insertions(+), 15 deletions(-)

-------------- next part --------------
diff --git a/dlls/user32/win.c b/dlls/user32/win.c
index d417c88..043f00c 100644
--- a/dlls/user32/win.c
+++ b/dlls/user32/win.c
@@ -1123,6 +1123,21 @@ static HWND WIN_CreateWindowEx( CREATEST
         return 0;
     }
 
+    /* Send the WM_GETMINMAXINFO message and fix the size if needed */
+    if ((cs->style & WS_THICKFRAME) || !(cs->style & (WS_POPUP | WS_CHILD)))
+    {
+        POINT maxSize, maxPos, minTrack, maxTrack;
+
+        WINPOS_GetMinMaxInfo( hwnd, &maxSize, &maxPos, &minTrack, &maxTrack);
+        if (maxSize.x < cs->cx) cs->cx = maxSize.x;
+        if (maxSize.y < cs->cy) cs->cy = maxSize.y;
+        if (cs->cx < 0) cs->cx = 0;
+        if (cs->cy < 0) cs->cy = 0;
+
+        SetRect( &rect, cs->x, cs->y, cs->x + cs->cx, cs->y + cs->cy );
+        if (!USER_Driver->pSetWindowPos( hwnd, 0, &rect, &rect, SWP_NOZORDER, NULL )) return FALSE;
+    }
+
     if (!USER_Driver->pCreateWindow( hwnd, cs, unicode))
     {
         WIN_DestroyWindow( hwnd );
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 76d7ea2..53e3c7f 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -1031,21 +1031,6 @@ BOOL X11DRV_CreateWindow( HWND hwnd, CRE
     /* get class or window DC if needed */
     alloc_window_dce( data );
 
-    /* Send the WM_GETMINMAXINFO message and fix the size if needed */
-    if ((cs->style & WS_THICKFRAME) || !(cs->style & (WS_POPUP | WS_CHILD)))
-    {
-        POINT maxSize, maxPos, minTrack, maxTrack;
-
-        WINPOS_GetMinMaxInfo( hwnd, &maxSize, &maxPos, &minTrack, &maxTrack);
-        if (maxSize.x < cs->cx) cs->cx = maxSize.x;
-        if (maxSize.y < cs->cy) cs->cy = maxSize.y;
-        if (cs->cx < 0) cs->cx = 0;
-        if (cs->cy < 0) cs->cy = 0;
-
-        SetRect( &rect, cs->x, cs->y, cs->x + cs->cx, cs->y + cs->cy );
-        if (!X11DRV_SetWindowPos( hwnd, 0, &rect, &rect, SWP_NOZORDER, NULL )) return FALSE;
-    }
-
     /* send WM_NCCREATE */
     TRACE( "hwnd %p cs %d,%d %dx%d\n", hwnd, cs->x, cs->y, cs->cx, cs->cy );
     if (unicode)



More information about the wine-patches mailing list