diff --git a/reactos/dll/win32/user32/misc/desktop.c b/reactos/dll/win32/user32/misc/desktop.c index 98e094ead58..26e78ffd3eb 100644 --- a/reactos/dll/win32/user32/misc/desktop.c +++ b/reactos/dll/win32/user32/misc/desktop.c @@ -40,6 +40,32 @@ DesktopWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam ) return 0; /* all other messages are ignored */ } +VOID +STDCALL +LogFontA2W(LPLOGFONTW pW, CONST LOGFONTA *pA) +{ +#define COPYS(f,len) MultiByteToWideChar ( CP_THREAD_ACP, 0, pA->f, len, pW->f, len ) +#define COPYN(f) pW->f = pA->f + + COPYN(lfHeight); + COPYN(lfWidth); + COPYN(lfEscapement); + COPYN(lfOrientation); + COPYN(lfWeight); + COPYN(lfItalic); + COPYN(lfUnderline); + COPYN(lfStrikeOut); + COPYN(lfCharSet); + COPYN(lfOutPrecision); + COPYN(lfClipPrecision); + COPYN(lfQuality); + COPYN(lfPitchAndFamily); + COPYS(lfFaceName,LF_FACESIZE); + +#undef COPYN +#undef COPYS +} + VOID STDCALL LogFontW2A(LPLOGFONTA pA, CONST LOGFONTW *pW) @@ -138,6 +164,32 @@ SystemParametersInfoA(UINT uiAction, LogFontW2A(&(nclma->lfMessageFont), &(nclmw.lfMessageFont)); return TRUE; } + case SPI_SETNONCLIENTMETRICS: + { + LPNONCLIENTMETRICSA nclma = (LPNONCLIENTMETRICSA)pvParam; + NONCLIENTMETRICSW nclmw; + nclmw.cbSize = sizeof(NONCLIENTMETRICSW); + nclmw.iBorderWidth = nclma->iBorderWidth; + nclmw.iScrollWidth = nclma->iScrollWidth; + nclmw.iScrollHeight = nclma->iScrollHeight; + nclmw.iCaptionWidth = nclma->iCaptionWidth; + nclmw.iCaptionHeight = nclma->iCaptionHeight; + nclmw.iSmCaptionWidth = nclma->iSmCaptionWidth; + nclmw.iSmCaptionHeight = nclma->iSmCaptionHeight; + nclmw.iMenuWidth = nclma->iMenuWidth; + nclmw.iMenuHeight = nclma->iMenuHeight; + LogFontA2W(&(nclmw.lfCaptionFont), &(nclma->lfCaptionFont)); + LogFontA2W(&(nclmw.lfSmCaptionFont), &(nclma->lfSmCaptionFont)); + LogFontA2W(&(nclmw.lfMenuFont), &(nclma->lfMenuFont)); + LogFontA2W(&(nclmw.lfStatusFont), &(nclma->lfStatusFont)); + LogFontA2W(&(nclmw.lfMessageFont), &(nclma->lfMessageFont)); + + if (!SystemParametersInfoW(uiAction, sizeof(NONCLIENTMETRICSW), + &nclmw, fWinIni)) + return FALSE; + + return TRUE; + } case SPI_GETICONTITLELOGFONT: { LOGFONTW lfw;