mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
SystemParametersInfo:
- SPI_GETNONCLIENTMETRICS and SPI_GETICONTITLELOGFONT now load their settings from the registry. - SPI_SET* aren't yet implemented, because i'd like to test my implementation before i commit them. svn path=/trunk/; revision=8206
This commit is contained in:
parent
02f6c6d6ee
commit
fcb45adac8
3 changed files with 75 additions and 34 deletions
|
@ -82,3 +82,6 @@ void DrawCaret(HWND hWnd, PTHRDCARETINFO CaretInfo);
|
|||
#define NtUserGetWindowContextHelpId(hwnd) \
|
||||
NtUserCallOneParam((DWORD)hwnd, ONEPARAM_ROUTINE_GETWNDCONTEXTHLPID)
|
||||
|
||||
LONG WINAPI RegCloseKey(HKEY);
|
||||
LONG WINAPI RegOpenKeyExW(HKEY,LPCWSTR,DWORD,REGSAM,PHKEY);
|
||||
LONG WINAPI RegQueryValueExW(HKEY,LPCWSTR,LPDWORD,LPDWORD,LPBYTE,LPDWORD);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: desktop.c,v 1.28 2004/01/23 23:38:26 ekohl Exp $
|
||||
/* $Id: desktop.c,v 1.29 2004/02/16 07:25:01 rcampbell Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS user32.dll
|
||||
|
@ -14,6 +14,8 @@
|
|||
#include <debug.h>
|
||||
#include <rosrtl/devmode.h>
|
||||
#include <rosrtl/logfont.h>
|
||||
#include <malloc.h>
|
||||
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
|
@ -87,6 +89,22 @@ SystemParametersInfoA(UINT uiAction,
|
|||
}
|
||||
|
||||
|
||||
BOOL IntGetFontMetricSetting(LPCWSTR lpKey, PLOGFONTW font)
|
||||
{
|
||||
HKEY hKey;
|
||||
DWORD dwType = REG_BINARY;
|
||||
DWORD dwSize = sizeof(LOGFONTW);
|
||||
BOOL bRet = FALSE;
|
||||
if ( RegOpenKeyExW(HKEY_CURRENT_USER, L"Control Panel\\Desktop\\WindowMetrics", 0, KEY_ALL_ACCESS, &hKey) == ERROR_SUCCESS )
|
||||
{
|
||||
if ( RegQueryValueExW(hKey, lpKey, NULL, &dwType, (LPBYTE)font, &dwSize) == ERROR_SUCCESS )
|
||||
bRet = TRUE;
|
||||
}
|
||||
|
||||
RegCloseKey(hKey);
|
||||
return bRet;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
|
@ -96,7 +114,58 @@ SystemParametersInfoW(UINT uiAction,
|
|||
PVOID pvParam,
|
||||
UINT fWinIni)
|
||||
{
|
||||
static LOGFONTW IconFont;
|
||||
static NONCLIENTMETRICSW pMetrics;
|
||||
static BOOL bInitialized = FALSE;
|
||||
|
||||
if (!bInitialized)
|
||||
{
|
||||
ZeroMemory(&IconFont, sizeof(LOGFONTW));
|
||||
ZeroMemory(&pMetrics, sizeof(NONCLIENTMETRICSW));
|
||||
|
||||
IntGetFontMetricSetting(L"CaptionFont", &pMetrics.lfCaptionFont);
|
||||
IntGetFontMetricSetting(L"SmCaptionFont", &pMetrics.lfSmCaptionFont);
|
||||
IntGetFontMetricSetting(L"MenuFont", &pMetrics.lfMenuFont);
|
||||
IntGetFontMetricSetting(L"StatusFont", &pMetrics.lfStatusFont);
|
||||
IntGetFontMetricSetting(L"MessageFont", &pMetrics.lfStatusFont);
|
||||
IntGetFontMetricSetting(L"IconFont", &IconFont);
|
||||
|
||||
pMetrics.iBorderWidth = 1;
|
||||
pMetrics.iScrollWidth = NtUserGetSystemMetrics(SM_CXVSCROLL);
|
||||
pMetrics.iScrollHeight = NtUserGetSystemMetrics(SM_CYHSCROLL);
|
||||
pMetrics.iCaptionWidth = NtUserGetSystemMetrics(SM_CXSIZE);
|
||||
pMetrics.iCaptionHeight = NtUserGetSystemMetrics(SM_CYSIZE);
|
||||
pMetrics.iSmCaptionWidth = NtUserGetSystemMetrics(SM_CXSMSIZE);
|
||||
pMetrics.iSmCaptionHeight = NtUserGetSystemMetrics(SM_CYSMSIZE);
|
||||
pMetrics.iMenuWidth = NtUserGetSystemMetrics(SM_CXMENUSIZE);
|
||||
pMetrics.iMenuHeight = NtUserGetSystemMetrics(SM_CYMENUSIZE);
|
||||
pMetrics.cbSize = sizeof(LPNONCLIENTMETRICSW);
|
||||
|
||||
bInitialized = TRUE;
|
||||
}
|
||||
switch(uiAction)
|
||||
{
|
||||
|
||||
case SPI_GETICONTITLELOGFONT:
|
||||
{
|
||||
memcpy(pvParam, (PVOID)&IconFont, sizeof(LOGFONTW));
|
||||
return TRUE;
|
||||
}
|
||||
case SPI_GETNONCLIENTMETRICS:
|
||||
{
|
||||
/* FIXME: Is this windows default behavior? */
|
||||
LPNONCLIENTMETRICSW lpMetrics = (LPNONCLIENTMETRICSW)pvParam;
|
||||
if ( lpMetrics->cbSize != sizeof(NONCLIENTMETRICSW) ||
|
||||
uiParam != sizeof(NONCLIENTMETRICSW ))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
memcpy(pvParam, (PVOID)&pMetrics, sizeof(NONCLIENTMETRICSW));
|
||||
return TRUE;
|
||||
}
|
||||
default:
|
||||
return NtUserSystemParametersInfo(uiAction, uiParam, pvParam, fWinIni);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: misc.c,v 1.49 2004/02/15 07:39:12 gvg Exp $
|
||||
/* $Id: misc.c,v 1.50 2004/02/16 07:25:01 rcampbell Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -548,37 +548,6 @@ NtUserSystemParametersInfo(
|
|||
}
|
||||
return TRUE;
|
||||
}
|
||||
case SPI_GETNONCLIENTMETRICS:
|
||||
{
|
||||
/* FIXME - use MmCopyToCaller() !!! */
|
||||
LPNONCLIENTMETRICSW pMetrics = (LPNONCLIENTMETRICSW)pvParam;
|
||||
|
||||
if (pMetrics->cbSize != sizeof(NONCLIENTMETRICSW) ||
|
||||
uiParam != sizeof(NONCLIENTMETRICSW))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
memset((char *)pvParam + sizeof(pMetrics->cbSize), 0,
|
||||
pMetrics->cbSize - sizeof(pMetrics->cbSize));
|
||||
|
||||
pMetrics->iBorderWidth = 1;
|
||||
pMetrics->iScrollWidth = NtUserGetSystemMetrics(SM_CXVSCROLL);
|
||||
pMetrics->iScrollHeight = NtUserGetSystemMetrics(SM_CYHSCROLL);
|
||||
pMetrics->iCaptionWidth = NtUserGetSystemMetrics(SM_CXSIZE);
|
||||
pMetrics->iCaptionHeight = NtUserGetSystemMetrics(SM_CYSIZE);
|
||||
memcpy((LPVOID)&(pMetrics->lfCaptionFont), &CaptionFont, sizeof(CaptionFont));
|
||||
pMetrics->lfCaptionFont.lfWeight = FW_BOLD;
|
||||
pMetrics->iSmCaptionWidth = NtUserGetSystemMetrics(SM_CXSMSIZE);
|
||||
pMetrics->iSmCaptionHeight = NtUserGetSystemMetrics(SM_CYSMSIZE);
|
||||
memcpy((LPVOID)&(pMetrics->lfSmCaptionFont), &CaptionFont, sizeof(CaptionFont));
|
||||
pMetrics->iMenuWidth = NtUserGetSystemMetrics(SM_CXMENUSIZE);
|
||||
pMetrics->iMenuHeight = NtUserGetSystemMetrics(SM_CYMENUSIZE);
|
||||
memcpy((LPVOID)&(pMetrics->lfMenuFont), &CaptionFont, sizeof(CaptionFont));
|
||||
memcpy((LPVOID)&(pMetrics->lfStatusFont), &CaptionFont, sizeof(CaptionFont));
|
||||
memcpy((LPVOID)&(pMetrics->lfMessageFont), &CaptionFont, sizeof(CaptionFont));
|
||||
return TRUE;
|
||||
}
|
||||
case SPI_GETGRADIENTCAPTIONS:
|
||||
{
|
||||
HDC hDC;
|
||||
|
|
Loading…
Reference in a new issue