Initialize MinMax.ptReserved, use better defaults for child windows.

oldstable
Dmitry Timoshkov 2003-10-24 04:22:11 +00:00 committed by Alexandre Julliard
parent c99317a8c9
commit dfa1f6a82a
1 changed files with 25 additions and 2 deletions

View File

@ -740,11 +740,25 @@ void WINPOS_GetMinMaxInfo( HWND hwnd, POINT *maxSize, POINT *maxPos,
INT xinc, yinc;
LONG style = GetWindowLongA( hwnd, GWL_STYLE );
LONG exstyle = GetWindowLongA( hwnd, GWL_EXSTYLE );
RECT rc;
/* Compute default values */
MinMax.ptMaxSize.x = GetSystemMetrics(SM_CXSCREEN);
MinMax.ptMaxSize.y = GetSystemMetrics(SM_CYSCREEN);
GetWindowRect(hwnd, &rc);
MinMax.ptReserved.x = rc.left;
MinMax.ptReserved.y = rc.top;
if (style & WS_CHILD)
{
GetClientRect(GetParent(hwnd), &rc);
MinMax.ptMaxSize.x = rc.right;
MinMax.ptMaxSize.y = rc.bottom;
}
else
{
MinMax.ptMaxSize.x = GetSystemMetrics(SM_CXSCREEN);
MinMax.ptMaxSize.y = GetSystemMetrics(SM_CYSCREEN);
}
MinMax.ptMinTrackSize.x = GetSystemMetrics(SM_CXMINTRACK);
MinMax.ptMinTrackSize.y = GetSystemMetrics(SM_CYMINTRACK);
MinMax.ptMaxTrackSize.x = GetSystemMetrics(SM_CXSCREEN);
@ -1191,6 +1205,8 @@ HDWP WINAPI BeginDeferWindowPos( INT count )
HDWP handle;
DWP *pDWP;
TRACE("%d\n", count);
if (count < 0)
{
SetLastError(ERROR_INVALID_PARAMETER);
@ -1207,6 +1223,8 @@ HDWP WINAPI BeginDeferWindowPos( INT count )
pDWP->valid = TRUE;
pDWP->wMagic = DWP_MAGIC;
pDWP->hwndParent = 0;
TRACE("returning hdwp %p\n", handle);
return handle;
}
@ -1222,6 +1240,9 @@ HDWP WINAPI DeferWindowPos( HDWP hdwp, HWND hwnd, HWND hwndAfter,
int i;
HDWP newhdwp = hdwp,retvalue;
TRACE("hdwp %p, hwnd %p, after %p, %d,%d (%dx%d), flags %08x\n",
hdwp, hwnd, hwndAfter, x, y, cx, cy, flags);
hwnd = WIN_GetFullHandle( hwnd );
if (hwnd == GetDesktopWindow()) return 0;
@ -1295,6 +1316,8 @@ BOOL WINAPI EndDeferWindowPos( HDWP hdwp )
BOOL res = TRUE;
int i;
TRACE("%p\n", hdwp);
pDWP = (DWP *) USER_HEAP_LIN_ADDR( hdwp );
if (!pDWP) return FALSE;
for (i = 0, winpos = pDWP->winPos; i < pDWP->actualCount; i++, winpos++)