-Force all top level windows to update the size and position of their non client area when SPI_SETNONCLIENTMETRICS is used
-Should fix changing the non client metrics like caption height for open windows (before this we needed to close and reopen existing windows to let them be painted properly)

svn path=/trunk/; revision=54186
This commit is contained in:
Giannis Adamopoulos 2011-10-18 10:54:13 +00:00
parent 049399ec77
commit 144e71d4b2

View file

@ -694,6 +694,41 @@ SpiSetWallpaper(PVOID pvParam, FLONG fl)
return (UINT_PTR)KEY_DESKTOP;
}
static BOOL
SpiNotifyNCMetricsChanged()
{
PWND pwndDesktop, pwndCurrent;
HWND *ahwnd;
USER_REFERENCE_ENTRY Ref;
int i;
pwndDesktop = UserGetDesktopWindow();
ASSERT(pwndDesktop);
ahwnd = IntWinListChildren(pwndDesktop);
if(!ahwnd)
return FALSE;
for (i = 0; ahwnd[i]; i++)
{
pwndCurrent = UserGetWindowObject(ahwnd[i]);
if(!pwndCurrent)
continue;
UserRefObjectCo(pwndCurrent, &Ref);
co_WinPosSetWindowPos(pwndCurrent, 0, pwndCurrent->rcWindow.left,pwndCurrent->rcWindow.top,
pwndCurrent->rcWindow.right-pwndCurrent->rcWindow.left
,pwndCurrent->rcWindow.bottom - pwndCurrent->rcWindow.top,
SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOCOPYBITS|
SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW);
UserDerefObjectCo(pwndCurrent);
}
ExFreePool(ahwnd);
return TRUE;
}
static
UINT_PTR
SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
@ -863,6 +898,8 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
SpiStoreFont(L"StatusFont", &gspv.ncm.lfStatusFont);
SpiStoreFont(L"MessageFont", &gspv.ncm.lfMessageFont);
}
if(!SpiNotifyNCMetricsChanged())
return 0;
return (UINT_PTR)KEY_METRIC;
case SPI_GETMINIMIZEDMETRICS: