mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
- Make IntSystemParametersInfo send a WM_SETTINGCHANGE message when needed.
- Some code cleanup svn path=/trunk/; revision=25423
This commit is contained in:
parent
b2c4c0e76e
commit
dc8aa9ffd7
1 changed files with 79 additions and 59 deletions
|
@ -909,6 +909,7 @@ IntSystemParametersInfo(
|
||||||
{
|
{
|
||||||
PWINSTATION_OBJECT WinStaObject;
|
PWINSTATION_OBJECT WinStaObject;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
BOOL bChanged = FALSE;
|
||||||
|
|
||||||
static BOOL bInitialized = FALSE;
|
static BOOL bInitialized = FALSE;
|
||||||
static LOGFONTW IconFont;
|
static LOGFONTW IconFont;
|
||||||
|
@ -956,16 +957,18 @@ IntSystemParametersInfo(
|
||||||
case SPI_SETDOUBLECLKHEIGHT:
|
case SPI_SETDOUBLECLKHEIGHT:
|
||||||
case SPI_SETDOUBLECLICKTIME:
|
case SPI_SETDOUBLECLICKTIME:
|
||||||
case SPI_SETDESKWALLPAPER:
|
case SPI_SETDESKWALLPAPER:
|
||||||
|
case SPI_SETSCREENSAVERRUNNING:
|
||||||
|
case SPI_SETSCREENSAVETIMEOUT:
|
||||||
|
case SPI_SETFLATMENU:
|
||||||
|
/* We will change something, so set the flag here */
|
||||||
|
bChanged = TRUE;
|
||||||
case SPI_GETDESKWALLPAPER:
|
case SPI_GETDESKWALLPAPER:
|
||||||
case SPI_GETWHEELSCROLLLINES:
|
case SPI_GETWHEELSCROLLLINES:
|
||||||
case SPI_GETWHEELSCROLLCHARS:
|
case SPI_GETWHEELSCROLLCHARS:
|
||||||
case SPI_SETSCREENSAVERRUNNING:
|
|
||||||
case SPI_GETSCREENSAVERRUNNING:
|
case SPI_GETSCREENSAVERRUNNING:
|
||||||
case SPI_GETSCREENSAVETIMEOUT:
|
case SPI_GETSCREENSAVETIMEOUT:
|
||||||
case SPI_SETSCREENSAVETIMEOUT:
|
|
||||||
case SPI_GETSCREENSAVEACTIVE:
|
case SPI_GETSCREENSAVEACTIVE:
|
||||||
case SPI_GETFLATMENU:
|
case SPI_GETFLATMENU:
|
||||||
case SPI_SETFLATMENU:
|
|
||||||
{
|
{
|
||||||
PSYSTEM_CURSORINFO CurInfo;
|
PSYSTEM_CURSORINFO CurInfo;
|
||||||
|
|
||||||
|
@ -982,43 +985,42 @@ IntSystemParametersInfo(
|
||||||
switch(uiAction)
|
switch(uiAction)
|
||||||
{
|
{
|
||||||
case SPI_GETFLATMENU:
|
case SPI_GETFLATMENU:
|
||||||
if (pvParam != NULL) *((UINT*)pvParam) = WinStaObject->FlatMenu;
|
ASSERT(pvParam);
|
||||||
return TRUE;
|
*((UINT*)pvParam) = WinStaObject->FlatMenu;
|
||||||
break;
|
break;
|
||||||
case SPI_SETFLATMENU:
|
case SPI_SETFLATMENU:
|
||||||
WinStaObject->FlatMenu = uiParam;
|
WinStaObject->FlatMenu = uiParam;
|
||||||
break;
|
break;
|
||||||
case SPI_GETSCREENSAVETIMEOUT:
|
case SPI_GETSCREENSAVETIMEOUT:
|
||||||
if (pvParam != NULL) *((UINT*)pvParam) = WinStaObject->ScreenSaverTimeOut;
|
ASSERT(pvParam);
|
||||||
return TRUE;
|
*((UINT*)pvParam) = WinStaObject->ScreenSaverTimeOut;
|
||||||
break;
|
break;
|
||||||
case SPI_SETSCREENSAVETIMEOUT:
|
case SPI_SETSCREENSAVETIMEOUT:
|
||||||
WinStaObject->ScreenSaverTimeOut = uiParam;
|
WinStaObject->ScreenSaverTimeOut = uiParam;
|
||||||
break;
|
break;
|
||||||
case SPI_GETSCREENSAVERRUNNING:
|
case SPI_GETSCREENSAVERRUNNING:
|
||||||
if (pvParam != NULL) *((BOOL*)pvParam) = WinStaObject->ScreenSaverRunning;
|
if (pvParam != NULL) *((BOOL*)pvParam) = WinStaObject->ScreenSaverRunning;
|
||||||
return TRUE;
|
|
||||||
break;
|
break;
|
||||||
case SPI_SETSCREENSAVERRUNNING:
|
case SPI_SETSCREENSAVERRUNNING:
|
||||||
if (pvParam != NULL) *((BOOL*)pvParam) = WinStaObject->ScreenSaverRunning;
|
if (pvParam != NULL) *((BOOL*)pvParam) = WinStaObject->ScreenSaverRunning;
|
||||||
WinStaObject->ScreenSaverRunning = uiParam;
|
WinStaObject->ScreenSaverRunning = uiParam;
|
||||||
break;
|
break;
|
||||||
case SPI_GETSCREENSAVEACTIVE:
|
case SPI_GETSCREENSAVEACTIVE:
|
||||||
/* FIXME: how to disable the screensaver? */
|
/* FIXME: how to disable the screensaver? */
|
||||||
if (pvParam != NULL) *((BOOL*)pvParam) = TRUE;
|
ASSERT(pvParam);
|
||||||
return TRUE;
|
*((BOOL*)pvParam) = TRUE;
|
||||||
break;
|
break;
|
||||||
case SPI_GETWHEELSCROLLLINES:
|
case SPI_GETWHEELSCROLLLINES:
|
||||||
|
ASSERT(pvParam);
|
||||||
CurInfo = IntGetSysCursorInfo(WinStaObject);
|
CurInfo = IntGetSysCursorInfo(WinStaObject);
|
||||||
if (pvParam != NULL) *((UINT*)pvParam) = CurInfo->WheelScroLines;
|
*((UINT*)pvParam) = CurInfo->WheelScroLines;
|
||||||
/* FIXME add this value to scroll list as scroll value ?? */
|
/* FIXME add this value to scroll list as scroll value ?? */
|
||||||
return TRUE;
|
|
||||||
break;
|
break;
|
||||||
case SPI_GETWHEELSCROLLCHARS:
|
case SPI_GETWHEELSCROLLCHARS:
|
||||||
|
ASSERT(pvParam);
|
||||||
CurInfo = IntGetSysCursorInfo(WinStaObject);
|
CurInfo = IntGetSysCursorInfo(WinStaObject);
|
||||||
if (pvParam != NULL) *((UINT*)pvParam) = CurInfo->WheelScroChars;
|
*((UINT*)pvParam) = CurInfo->WheelScroChars;
|
||||||
// FIXME add this value to scroll list as scroll value ??
|
// FIXME add this value to scroll list as scroll value ??
|
||||||
return TRUE;
|
|
||||||
break;
|
break;
|
||||||
case SPI_SETDOUBLECLKWIDTH:
|
case SPI_SETDOUBLECLKWIDTH:
|
||||||
CurInfo = IntGetSysCursorInfo(WinStaObject);
|
CurInfo = IntGetSysCursorInfo(WinStaObject);
|
||||||
|
@ -1125,7 +1127,7 @@ IntSystemParametersInfo(
|
||||||
if(!KeyValuePartialInfo)
|
if(!KeyValuePartialInfo)
|
||||||
{
|
{
|
||||||
NtClose(KeyHandle);
|
NtClose(KeyHandle);
|
||||||
return 0;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = ZwQueryValueKey(KeyHandle, &Tile, KeyValuePartialInformation,
|
Status = ZwQueryValueKey(KeyHandle, &Tile, KeyValuePartialInformation,
|
||||||
|
@ -1134,7 +1136,7 @@ IntSystemParametersInfo(
|
||||||
{
|
{
|
||||||
ZwClose(KeyHandle);
|
ZwClose(KeyHandle);
|
||||||
ExFreePool(KeyValuePartialInfo);
|
ExFreePool(KeyValuePartialInfo);
|
||||||
return 0;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
Tile.Length = KeyValuePartialInfo->DataLength;
|
Tile.Length = KeyValuePartialInfo->DataLength;
|
||||||
|
@ -1160,7 +1162,7 @@ IntSystemParametersInfo(
|
||||||
if(!KeyValuePartialInfo)
|
if(!KeyValuePartialInfo)
|
||||||
{
|
{
|
||||||
ZwClose(KeyHandle);
|
ZwClose(KeyHandle);
|
||||||
return 0;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = ZwQueryValueKey(KeyHandle, &Style, KeyValuePartialInformation,
|
Status = ZwQueryValueKey(KeyHandle, &Style, KeyValuePartialInformation,
|
||||||
|
@ -1169,7 +1171,7 @@ IntSystemParametersInfo(
|
||||||
{
|
{
|
||||||
ZwClose(KeyHandle);
|
ZwClose(KeyHandle);
|
||||||
ExFreePool(KeyValuePartialInfo);
|
ExFreePool(KeyValuePartialInfo);
|
||||||
return 0;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
Style.Length = KeyValuePartialInfo->DataLength;
|
Style.Length = KeyValuePartialInfo->DataLength;
|
||||||
|
@ -1210,7 +1212,7 @@ IntSystemParametersInfo(
|
||||||
/* FIXME save the value to the registry */
|
/* FIXME save the value to the registry */
|
||||||
|
|
||||||
ObDereferenceObject(WinStaObject);
|
ObDereferenceObject(WinStaObject);
|
||||||
return TRUE;
|
break;
|
||||||
}
|
}
|
||||||
case SPI_SETWORKAREA:
|
case SPI_SETWORKAREA:
|
||||||
{
|
{
|
||||||
|
@ -1226,8 +1228,9 @@ IntSystemParametersInfo(
|
||||||
ASSERT(pvParam);
|
ASSERT(pvParam);
|
||||||
rc = (RECT*)pvParam;
|
rc = (RECT*)pvParam;
|
||||||
Desktop->WorkArea = *rc;
|
Desktop->WorkArea = *rc;
|
||||||
|
bChanged = TRUE;
|
||||||
|
|
||||||
return TRUE;
|
break;
|
||||||
}
|
}
|
||||||
case SPI_GETWORKAREA:
|
case SPI_GETWORKAREA:
|
||||||
{
|
{
|
||||||
|
@ -1242,13 +1245,14 @@ IntSystemParametersInfo(
|
||||||
ASSERT(pvParam);
|
ASSERT(pvParam);
|
||||||
IntGetDesktopWorkArea(Desktop, (PRECT)pvParam);
|
IntGetDesktopWorkArea(Desktop, (PRECT)pvParam);
|
||||||
|
|
||||||
return TRUE;
|
break;
|
||||||
}
|
}
|
||||||
case SPI_SETGRADIENTCAPTIONS:
|
case SPI_SETGRADIENTCAPTIONS:
|
||||||
{
|
{
|
||||||
GradientCaptions = (pvParam != NULL);
|
GradientCaptions = (pvParam != NULL);
|
||||||
/* FIXME - should be checked if the color depth is higher than 8bpp? */
|
/* FIXME - should be checked if the color depth is higher than 8bpp? */
|
||||||
return TRUE;
|
bChanged = TRUE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case SPI_GETGRADIENTCAPTIONS:
|
case SPI_GETGRADIENTCAPTIONS:
|
||||||
{
|
{
|
||||||
|
@ -1256,78 +1260,83 @@ IntSystemParametersInfo(
|
||||||
BOOL Ret = GradientCaptions;
|
BOOL Ret = GradientCaptions;
|
||||||
|
|
||||||
hDC = IntGetScreenDC();
|
hDC = IntGetScreenDC();
|
||||||
if(hDC)
|
if(!hDC)
|
||||||
{
|
{
|
||||||
Ret = (NtGdiGetDeviceCaps(hDC, BITSPIXEL) > 8) && Ret;
|
return FALSE;
|
||||||
|
|
||||||
ASSERT(pvParam);
|
|
||||||
*((PBOOL)pvParam) = Ret;
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
return FALSE;
|
Ret = (NtGdiGetDeviceCaps(hDC, BITSPIXEL) > 8) && Ret;
|
||||||
|
|
||||||
|
ASSERT(pvParam);
|
||||||
|
*((PBOOL)pvParam) = Ret;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case SPI_SETFONTSMOOTHING:
|
case SPI_SETFONTSMOOTHING:
|
||||||
{
|
{
|
||||||
IntEnableFontRendering(uiParam != 0);
|
IntEnableFontRendering(uiParam != 0);
|
||||||
return TRUE;
|
bChanged = TRUE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case SPI_GETFONTSMOOTHING:
|
case SPI_GETFONTSMOOTHING:
|
||||||
{
|
{
|
||||||
ASSERT(pvParam);
|
ASSERT(pvParam);
|
||||||
*((BOOL*)pvParam) = IntIsFontRenderingEnabled();
|
*((BOOL*)pvParam) = IntIsFontRenderingEnabled();
|
||||||
return TRUE;
|
break;
|
||||||
}
|
}
|
||||||
case SPI_GETICONTITLELOGFONT:
|
case SPI_GETICONTITLELOGFONT:
|
||||||
{
|
{
|
||||||
ASSERT(pvParam);
|
ASSERT(pvParam);
|
||||||
*((LOGFONTW*)pvParam) = IconFont;
|
*((LOGFONTW*)pvParam) = IconFont;
|
||||||
return TRUE;
|
break;
|
||||||
}
|
}
|
||||||
case SPI_GETNONCLIENTMETRICS:
|
case SPI_GETNONCLIENTMETRICS:
|
||||||
{
|
{
|
||||||
ASSERT(pvParam);
|
ASSERT(pvParam);
|
||||||
*((NONCLIENTMETRICSW*)pvParam) = pMetrics;
|
*((NONCLIENTMETRICSW*)pvParam) = pMetrics;
|
||||||
return TRUE;
|
break;
|
||||||
}
|
}
|
||||||
case SPI_SETNONCLIENTMETRICS:
|
case SPI_SETNONCLIENTMETRICS:
|
||||||
{
|
{
|
||||||
ASSERT(pvParam);
|
ASSERT(pvParam);
|
||||||
pMetrics = *((NONCLIENTMETRICSW*)pvParam);
|
pMetrics = *((NONCLIENTMETRICSW*)pvParam);
|
||||||
return TRUE;
|
bChanged = TRUE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case SPI_GETMINIMIZEDMETRICS:
|
case SPI_GETMINIMIZEDMETRICS:
|
||||||
{
|
{
|
||||||
ASSERT(pvParam);
|
ASSERT(pvParam);
|
||||||
*((MINIMIZEDMETRICS*)pvParam) = MinimizedMetrics;
|
*((MINIMIZEDMETRICS*)pvParam) = MinimizedMetrics;
|
||||||
return TRUE;
|
break;
|
||||||
}
|
}
|
||||||
case SPI_SETMINIMIZEDMETRICS:
|
case SPI_SETMINIMIZEDMETRICS:
|
||||||
{
|
{
|
||||||
ASSERT(pvParam);
|
ASSERT(pvParam);
|
||||||
MinimizedMetrics = *((MINIMIZEDMETRICS*)pvParam);
|
MinimizedMetrics = *((MINIMIZEDMETRICS*)pvParam);
|
||||||
return TRUE;
|
bChanged = TRUE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case SPI_GETFOCUSBORDERHEIGHT:
|
case SPI_GETFOCUSBORDERHEIGHT:
|
||||||
{
|
{
|
||||||
ASSERT(pvParam);
|
ASSERT(pvParam);
|
||||||
*((UINT*)pvParam) = FocusBorderHeight;
|
*((UINT*)pvParam) = FocusBorderHeight;
|
||||||
return TRUE;
|
break;
|
||||||
}
|
}
|
||||||
case SPI_GETFOCUSBORDERWIDTH:
|
case SPI_GETFOCUSBORDERWIDTH:
|
||||||
{
|
{
|
||||||
ASSERT(pvParam);
|
ASSERT(pvParam);
|
||||||
*((UINT*)pvParam) = FocusBorderWidth;
|
*((UINT*)pvParam) = FocusBorderWidth;
|
||||||
return TRUE;
|
break;
|
||||||
}
|
}
|
||||||
case SPI_SETFOCUSBORDERHEIGHT:
|
case SPI_SETFOCUSBORDERHEIGHT:
|
||||||
{
|
{
|
||||||
FocusBorderHeight = (UINT)pvParam;
|
FocusBorderHeight = (UINT)pvParam;
|
||||||
return TRUE;
|
bChanged = TRUE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case SPI_SETFOCUSBORDERWIDTH:
|
case SPI_SETFOCUSBORDERWIDTH:
|
||||||
{
|
{
|
||||||
FocusBorderWidth = (UINT)pvParam;
|
FocusBorderWidth = (UINT)pvParam;
|
||||||
return TRUE;
|
bChanged = TRUE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -1337,7 +1346,18 @@ IntSystemParametersInfo(
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return FALSE;
|
/* Did we change something ? */
|
||||||
|
if (bChanged)
|
||||||
|
{
|
||||||
|
/* Shall we send a WM_SETTINGCHANGE message ? */
|
||||||
|
if (fWinIni & (SPIF_UPDATEINIFILE | SPIF_SENDCHANGE))
|
||||||
|
{
|
||||||
|
/* Broadcast WM_SETTINGCHANGE to all toplevel windows */
|
||||||
|
/* FIXME: lParam should be pointer to a string containing the reg key */
|
||||||
|
UserPostMessage(HWND_BROADCAST, WM_SETTINGCHANGE, (WPARAM)uiAction, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1396,14 +1416,14 @@ UserSystemParametersInfo(
|
||||||
case SPI_GETGRADIENTCAPTIONS:
|
case SPI_GETGRADIENTCAPTIONS:
|
||||||
case SPI_GETFOCUSBORDERHEIGHT:
|
case SPI_GETFOCUSBORDERHEIGHT:
|
||||||
case SPI_GETFOCUSBORDERWIDTH:
|
case SPI_GETFOCUSBORDERWIDTH:
|
||||||
case SPI_GETWHEELSCROLLLINES:
|
case SPI_GETWHEELSCROLLLINES:
|
||||||
case SPI_GETWHEELSCROLLCHARS:
|
case SPI_GETWHEELSCROLLCHARS:
|
||||||
case SPI_GETSCREENSAVERRUNNING:
|
case SPI_GETSCREENSAVERRUNNING:
|
||||||
case SPI_SETSCREENSAVERRUNNING:
|
case SPI_SETSCREENSAVERRUNNING:
|
||||||
case SPI_GETSCREENSAVETIMEOUT:
|
case SPI_GETSCREENSAVETIMEOUT:
|
||||||
case SPI_SETSCREENSAVETIMEOUT:
|
case SPI_SETSCREENSAVETIMEOUT:
|
||||||
case SPI_GETSCREENSAVEACTIVE:
|
case SPI_GETSCREENSAVEACTIVE:
|
||||||
case SPI_GETFLATMENU:
|
case SPI_GETFLATMENU:
|
||||||
case SPI_SETFLATMENU:
|
case SPI_SETFLATMENU:
|
||||||
{
|
{
|
||||||
BOOL Ret;
|
BOOL Ret;
|
||||||
|
@ -1529,10 +1549,10 @@ UserSystemParametersInfo(
|
||||||
return( TRUE);
|
return( TRUE);
|
||||||
}
|
}
|
||||||
default :
|
default :
|
||||||
{
|
{
|
||||||
DPRINT1("FIXME: UNIMPLEMENTED SPI Code: %lx \n",uiAction );
|
DPRINT1("FIXME: UNIMPLEMENTED SPI Code: %lx \n",uiAction );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return( FALSE);
|
return( FALSE);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue