2 * System parameters functions
4 * Copyright 1994 Alexandre Julliard
16 #include "wine/winuser16.h"
22 #include "debugtools.h"
24 DEFAULT_DEBUG_CHANNEL(system);
26 static BOOL beep_active = TRUE;
28 /***********************************************************************
29 * GetTimerResolution (USER.14)
31 LONG WINAPI GetTimerResolution16(void)
36 /***********************************************************************
37 * ControlPanelInfo (USER.273)
39 void WINAPI ControlPanelInfo16( INT16 nInfoType, WORD wData, LPSTR lpBuffer )
41 FIXME("(%d, %04x, %p): stub.\n", nInfoType, wData, lpBuffer);
44 /* This function is a copy of the one in objects/font.c */
45 static void SYSPARAMS_LogFont32ATo16( const LOGFONTA* font32, LPLOGFONT16 font16 )
47 font16->lfHeight = font32->lfHeight;
48 font16->lfWidth = font32->lfWidth;
49 font16->lfEscapement = font32->lfEscapement;
50 font16->lfOrientation = font32->lfOrientation;
51 font16->lfWeight = font32->lfWeight;
52 font16->lfItalic = font32->lfItalic;
53 font16->lfUnderline = font32->lfUnderline;
54 font16->lfStrikeOut = font32->lfStrikeOut;
55 font16->lfCharSet = font32->lfCharSet;
56 font16->lfOutPrecision = font32->lfOutPrecision;
57 font16->lfClipPrecision = font32->lfClipPrecision;
58 font16->lfQuality = font32->lfQuality;
59 font16->lfPitchAndFamily = font32->lfPitchAndFamily;
60 lstrcpynA( font16->lfFaceName, font32->lfFaceName, LF_FACESIZE );
63 static void SYSPARAMS_LogFont32ATo32W( const LOGFONTA* font32A, LPLOGFONTW font32W )
65 font32W->lfHeight = font32A->lfHeight;
66 font32W->lfWidth = font32A->lfWidth;
67 font32W->lfEscapement = font32A->lfEscapement;
68 font32W->lfOrientation = font32A->lfOrientation;
69 font32W->lfWeight = font32A->lfWeight;
70 font32W->lfItalic = font32A->lfItalic;
71 font32W->lfUnderline = font32A->lfUnderline;
72 font32W->lfStrikeOut = font32A->lfStrikeOut;
73 font32W->lfCharSet = font32A->lfCharSet;
74 font32W->lfOutPrecision = font32A->lfOutPrecision;
75 font32W->lfClipPrecision = font32A->lfClipPrecision;
76 font32W->lfQuality = font32A->lfQuality;
77 font32W->lfPitchAndFamily = font32A->lfPitchAndFamily;
78 MultiByteToWideChar( CP_ACP, 0, font32A->lfFaceName, -1, font32W->lfFaceName, LF_FACESIZE );
79 font32W->lfFaceName[LF_FACESIZE-1] = 0;
82 static void SYSPARAMS_NonClientMetrics32ATo16( const NONCLIENTMETRICSA* lpnm32, LPNONCLIENTMETRICS16 lpnm16 )
84 lpnm16->iBorderWidth = lpnm32->iBorderWidth;
85 lpnm16->iScrollWidth = lpnm32->iScrollWidth;
86 lpnm16->iScrollHeight = lpnm32->iScrollHeight;
87 lpnm16->iCaptionWidth = lpnm32->iCaptionWidth;
88 lpnm16->iCaptionHeight = lpnm32->iCaptionHeight;
89 SYSPARAMS_LogFont32ATo16( &lpnm32->lfCaptionFont, &lpnm16->lfCaptionFont );
90 lpnm16->iSmCaptionWidth = lpnm32->iSmCaptionWidth;
91 lpnm16->iSmCaptionHeight = lpnm32->iSmCaptionHeight;
92 SYSPARAMS_LogFont32ATo16( &lpnm32->lfSmCaptionFont, &lpnm16->lfSmCaptionFont );
93 lpnm16->iMenuWidth = lpnm32->iMenuWidth;
94 lpnm16->iMenuHeight = lpnm32->iMenuHeight;
95 SYSPARAMS_LogFont32ATo16( &lpnm32->lfMenuFont, &lpnm16->lfMenuFont );
96 SYSPARAMS_LogFont32ATo16( &lpnm32->lfStatusFont, &lpnm16->lfStatusFont );
97 SYSPARAMS_LogFont32ATo16( &lpnm32->lfMessageFont, &lpnm16->lfMessageFont );
100 static void SYSPARAMS_NonClientMetrics32ATo32W( const NONCLIENTMETRICSA* lpnm32A, LPNONCLIENTMETRICSW lpnm32W )
102 lpnm32W->iBorderWidth = lpnm32A->iBorderWidth;
103 lpnm32W->iScrollWidth = lpnm32A->iScrollWidth;
104 lpnm32W->iScrollHeight = lpnm32A->iScrollHeight;
105 lpnm32W->iCaptionWidth = lpnm32A->iCaptionWidth;
106 lpnm32W->iCaptionHeight = lpnm32A->iCaptionHeight;
107 SYSPARAMS_LogFont32ATo32W( &lpnm32A->lfCaptionFont, &lpnm32W->lfCaptionFont );
108 lpnm32W->iSmCaptionWidth = lpnm32A->iSmCaptionWidth;
109 lpnm32W->iSmCaptionHeight = lpnm32A->iSmCaptionHeight;
110 SYSPARAMS_LogFont32ATo32W( &lpnm32A->lfSmCaptionFont, &lpnm32W->lfSmCaptionFont );
111 lpnm32W->iMenuWidth = lpnm32A->iMenuWidth;
112 lpnm32W->iMenuHeight = lpnm32A->iMenuHeight;
113 SYSPARAMS_LogFont32ATo32W( &lpnm32A->lfMenuFont, &lpnm32W->lfMenuFont );
114 SYSPARAMS_LogFont32ATo32W( &lpnm32A->lfStatusFont, &lpnm32W->lfStatusFont );
115 SYSPARAMS_LogFont32ATo32W( &lpnm32A->lfMessageFont, &lpnm32W->lfMessageFont );
118 /***********************************************************************
119 * SystemParametersInfoA (USER32.@)
121 BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam,
122 PVOID pvParam, UINT fWinIni )
124 #define WINE_SPI_FIXME(x) \
126 FIXME( "Unimplemented action: %u (%s)\n", x, #x ); \
127 SetLastError( ERROR_INVALID_SPI_VALUE ); \
130 #define WINE_SPI_WARN(x) \
132 WARN( "Ignored action: %u (%s)\n", x, #x ); \
137 TRACE("(%u, %u, %p, %u)\n", uiAction, uiParam, pvParam, fWinIni);
141 case SPI_GETBEEP: /* 1 */
142 *(BOOL *)pvParam = beep_active;
144 case SPI_SETBEEP: /* 2 */
145 beep_active = uiParam;
148 WINE_SPI_FIXME(SPI_GETMOUSE); /* 3 */
149 WINE_SPI_FIXME(SPI_SETMOUSE); /* 4 */
151 case SPI_GETBORDER: /* 5 */
152 *(INT *)pvParam = GetSystemMetrics( SM_CXFRAME );
154 WINE_SPI_WARN(SPI_SETBORDER); /* 6 */
156 case SPI_GETKEYBOARDSPEED: /* 10 */
157 *(DWORD *)pvParam = GetProfileIntA( "keyboard", "KeyboardSpeed", 30 );
159 WINE_SPI_WARN(SPI_SETKEYBOARDSPEED); /* 11 */
161 WINE_SPI_WARN(SPI_LANGDRIVER); /* 12 */
163 case SPI_ICONHORIZONTALSPACING: /* 13 */
164 /* FIXME Get/SetProfileInt */
166 /*SetSystemMetrics( SM_CXICONSPACING, uiParam )*/ ;
168 *(INT *)pvParam = GetSystemMetrics( SM_CXICONSPACING );
171 case SPI_GETSCREENSAVETIMEOUT: /* 14 */
174 timeout = USER_Driver.pGetScreenSaveTimeout();
176 timeout = GetProfileIntA( "windows", "ScreenSaveTimeout", 300 );
177 *(INT *)pvParam = timeout;
180 case SPI_SETSCREENSAVETIMEOUT: /* 15 */
181 USER_Driver.pSetScreenSaveTimeout( uiParam );
184 case SPI_GETSCREENSAVEACTIVE: /* 16 */
185 if (USER_Driver.pGetScreenSaveActive() ||
186 GetProfileIntA( "windows", "ScreenSaveActive", 1 ) == 1)
187 *(BOOL *)pvParam = TRUE;
189 *(BOOL *)pvParam = FALSE;
191 case SPI_SETSCREENSAVEACTIVE: /* 17 */
192 USER_Driver.pSetScreenSaveActive( uiParam );
195 case SPI_GETGRIDGRANULARITY: /* 18 */
196 *(INT *)pvParam = GetProfileIntA( "desktop", "GridGranularity", 1 );
198 WINE_SPI_FIXME(SPI_SETGRIDGRANULARITY); /* 19 */
200 case SPI_SETDESKWALLPAPER: /* 20 */
201 ret = SetDeskWallPaper( (LPSTR)pvParam );
203 case SPI_SETDESKPATTERN: /* 21 */
204 /* FIXME: the ability to specify a pattern in pvParam
205 doesn't seem to be documented for Win32 */
206 if ((INT16)uiParam == -1)
209 GetProfileStringA( "Desktop", "Pattern",
210 "170 85 170 85 170 85 170 85",
211 buffer, sizeof(buffer) );
212 ret = DESKTOP_SetPattern( (LPSTR)buffer );
214 ret = DESKTOP_SetPattern( (LPSTR)pvParam );
217 case SPI_GETKEYBOARDDELAY: /* 22 */
218 *(INT *)pvParam = GetProfileIntA( "keyboard", "KeyboardDelay", 1 );
220 WINE_SPI_WARN(SPI_SETKEYBOARDDELAY); /* 23 */
222 case SPI_ICONVERTICALSPACING: /* 24 */
223 /* FIXME Get/SetProfileInt */
225 /*SetSystemMetrics( SM_CYICONSPACING, uiParam )*/ ;
227 *(INT *)pvParam = GetSystemMetrics( SM_CYICONSPACING );
230 case SPI_GETICONTITLEWRAP: /* 25 */
231 *(BOOL *)pvParam = GetProfileIntA( "desktop", "IconTitleWrap", TRUE );
233 WINE_SPI_FIXME(SPI_SETICONTITLEWRAP); /* 26 */
235 case SPI_GETMENUDROPALIGNMENT: /* 27 */
236 *(BOOL *)pvParam = GetSystemMetrics( SM_MENUDROPALIGNMENT ); /* XXX check this */
238 WINE_SPI_FIXME(SPI_SETMENUDROPALIGNMENT); /* 28 */
240 WINE_SPI_WARN(SPI_SETDOUBLECLKWIDTH); /* 29 */
241 WINE_SPI_WARN(SPI_SETDOUBLECLKHEIGHT); /* 30 */
243 case SPI_GETICONTITLELOGFONT: /* 31 */
245 LPLOGFONTA lpLogFont = (LPLOGFONTA)pvParam;
247 /* from now on we always have an alias for MS Sans Serif */
249 GetProfileStringA( "Desktop", "IconTitleFaceName", "MS Sans Serif",
250 lpLogFont->lfFaceName, LF_FACESIZE );
251 lpLogFont->lfHeight = -GetProfileIntA( "Desktop", "IconTitleSize", 13 );
252 lpLogFont->lfWidth = 0;
253 lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
254 lpLogFont->lfWeight = FW_NORMAL;
255 lpLogFont->lfItalic = FALSE;
256 lpLogFont->lfStrikeOut = FALSE;
257 lpLogFont->lfUnderline = FALSE;
258 lpLogFont->lfCharSet = ANSI_CHARSET;
259 lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
260 lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
261 lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
265 WINE_SPI_WARN(SPI_SETDOUBLECLICKTIME); /* 32 */
267 WINE_SPI_FIXME(SPI_SETMOUSEBUTTONSWAP); /* 33 */
268 WINE_SPI_FIXME(SPI_SETICONTITLELOGFONT); /* 34 */
270 case SPI_GETFASTTASKSWITCH: /* 35 */
271 if (GetProfileIntA( "windows", "CoolSwitch", 1 ) == 1)
272 *(BOOL *)pvParam = TRUE;
274 *(BOOL *)pvParam = FALSE;
276 WINE_SPI_WARN(SPI_SETFASTTASKSWITCH); /* 36 */
278 WINE_SPI_WARN(SPI_SETDRAGFULLWINDOWS); /* 37 WINVER >= 0x0400 */
279 case SPI_GETDRAGFULLWINDOWS: /* 38 WINVER >= 0x0400 */
283 DWORD dwBufferSize = sizeof(buffer);
285 *(BOOL *)pvParam = FALSE;
286 if (RegOpenKeyExA( HKEY_CURRENT_USER,
287 "Control Panel\\desktop",
288 0, KEY_QUERY_VALUE, &hKey ) == ERROR_SUCCESS)
290 if (RegQueryValueExA( hKey, "DragFullWindows", NULL,
291 0, buffer, &dwBufferSize ) == ERROR_SUCCESS)
292 *(BOOL *)pvParam = atoi( buffer ) != 0;
299 case SPI_GETNONCLIENTMETRICS: /* 41 WINVER >= 0x400 */
301 LPNONCLIENTMETRICSA lpnm = (LPNONCLIENTMETRICSA)pvParam;
303 if (lpnm->cbSize == sizeof(NONCLIENTMETRICSA))
305 LPLOGFONTA lpLogFont = &(lpnm->lfMenuFont);
307 /* clear the struct, so we have 'sane' members */
309 (char *)pvParam + sizeof(lpnm->cbSize),
311 lpnm->cbSize - sizeof(lpnm->cbSize)
314 /* FIXME: initialize geometry entries */
315 /* FIXME: As these values are presumably in device units,
316 * we should calculate the defaults based on the screen dpi
319 lpnm->iCaptionWidth = ((TWEAK_WineLook > WIN31_LOOK) ? 32 : 20);
320 lpnm->iCaptionHeight = lpnm->iCaptionWidth;
321 SystemParametersInfoA( SPI_GETICONTITLELOGFONT, 0, (LPVOID)&(lpnm->lfCaptionFont), 0 );
322 lpnm->lfCaptionFont.lfWeight = FW_BOLD;
325 lpnm->iSmCaptionWidth = ((TWEAK_WineLook > WIN31_LOOK) ? 32 : 17);
326 lpnm->iSmCaptionHeight = lpnm->iSmCaptionWidth;
327 SystemParametersInfoA( SPI_GETICONTITLELOGFONT, 0, (LPVOID)&(lpnm->lfSmCaptionFont), 0 );
329 /* menus, FIXME: names of wine.conf entrys are bogus */
331 lpnm->iMenuWidth = GetProfileIntA( "Desktop", "MenuWidth", 13 ); /* size of the menu buttons*/
332 lpnm->iMenuHeight = GetProfileIntA( "Desktop", "MenuHeight",
333 (TWEAK_WineLook > WIN31_LOOK) ? 13 : 27 );
335 GetProfileStringA( "Desktop", "MenuFont",
336 (TWEAK_WineLook > WIN31_LOOK) ? "MS Sans Serif": "System",
337 lpLogFont->lfFaceName, LF_FACESIZE );
339 lpLogFont->lfHeight = -GetProfileIntA( "Desktop", "MenuFontSize", 13 );
340 lpLogFont->lfWidth = 0;
341 lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
342 lpLogFont->lfWeight = (TWEAK_WineLook > WIN31_LOOK) ? FW_NORMAL : FW_BOLD;
343 lpLogFont->lfItalic = FALSE;
344 lpLogFont->lfStrikeOut = FALSE;
345 lpLogFont->lfUnderline = FALSE;
346 lpLogFont->lfCharSet = ANSI_CHARSET;
347 lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
348 lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
349 lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
351 SystemParametersInfoA( SPI_GETICONTITLELOGFONT, 0,
352 (LPVOID)&(lpnm->lfStatusFont), 0 );
353 SystemParametersInfoA( SPI_GETICONTITLELOGFONT, 0,
354 (LPVOID)&(lpnm->lfMessageFont), 0 );
358 WARN("size mismatch !! (is %d; should be %d)\n", lpnm->cbSize, sizeof(NONCLIENTMETRICSA));
359 /* FIXME: SetLastError? */
364 WINE_SPI_FIXME(SPI_SETNONCLIENTMETRICS); /* 42 WINVER >= 0x400 */
366 WINE_SPI_FIXME(SPI_GETMINIMIZEDMETRICS); /* 43 WINVER >= 0x400 */
367 WINE_SPI_FIXME(SPI_SETMINIMIZEDMETRICS); /* 44 WINVER >= 0x400 */
369 case SPI_GETICONMETRICS: /* 45 WINVER >= 0x400 */
371 LPICONMETRICSA lpIcon = pvParam;
372 if(lpIcon && lpIcon->cbSize == sizeof(*lpIcon))
374 SystemParametersInfoA( SPI_ICONHORIZONTALSPACING, 0,
375 &lpIcon->iHorzSpacing, FALSE );
376 SystemParametersInfoA( SPI_ICONVERTICALSPACING, 0,
377 &lpIcon->iVertSpacing, FALSE );
378 SystemParametersInfoA( SPI_GETICONTITLEWRAP, 0,
379 &lpIcon->iTitleWrap, FALSE );
380 SystemParametersInfoA( SPI_GETICONTITLELOGFONT, 0,
381 &lpIcon->lfFont, FALSE );
389 WINE_SPI_FIXME(SPI_SETICONMETRICS); /* 46 WINVER >= 0x400 */
391 WINE_SPI_FIXME(SPI_SETWORKAREA); /* 47 WINVER >= 0x400 */
392 case SPI_GETWORKAREA: /* 48 WINVER >= 0x400 */
393 SetRect( (RECT *)pvParam, 0, 0,
394 GetSystemMetrics( SM_CXSCREEN ),
395 GetSystemMetrics( SM_CYSCREEN ) );
398 WINE_SPI_FIXME(SPI_SETPENWINDOWS); /* 49 WINVER >= 0x400 */
400 WINE_SPI_FIXME(SPI_GETFILTERKEYS); /* 50 */
401 WINE_SPI_FIXME(SPI_SETFILTERKEYS); /* 51 */
402 WINE_SPI_FIXME(SPI_GETTOGGLEKEYS); /* 52 */
403 WINE_SPI_FIXME(SPI_SETTOGGLEKEYS); /* 53 */
404 WINE_SPI_FIXME(SPI_GETMOUSEKEYS); /* 54 */
405 WINE_SPI_FIXME(SPI_SETMOUSEKEYS); /* 55 */
406 WINE_SPI_FIXME(SPI_GETSHOWSOUNDS); /* 56 */
407 WINE_SPI_FIXME(SPI_SETSHOWSOUNDS); /* 57 */
408 WINE_SPI_FIXME(SPI_GETSTICKYKEYS); /* 58 */
409 WINE_SPI_FIXME(SPI_SETSTICKYKEYS); /* 59 */
410 WINE_SPI_FIXME(SPI_GETACCESSTIMEOUT); /* 60 */
411 WINE_SPI_FIXME(SPI_SETACCESSTIMEOUT); /* 61 */
413 WINE_SPI_FIXME(SPI_GETSERIALKEYS); /* 62 WINVER >= 0x400 */
414 WINE_SPI_FIXME(SPI_SETSERIALKEYS); /* 63 WINVER >= 0x400 */
416 WINE_SPI_FIXME(SPI_GETSOUNDSENTRY); /* 64 */
417 WINE_SPI_FIXME(SPI_SETSOUNDSENTRY); /* 65 */
419 case SPI_GETHIGHCONTRAST: /* 66 WINVER >= 0x400 */
421 LPHIGHCONTRASTA lpHighContrastA = (LPHIGHCONTRASTA)pvParam;
422 WARN("SPI_GETHIGHCONTRAST not fully implemented\n");
423 if (lpHighContrastA->cbSize == sizeof(HIGHCONTRASTA))
425 /* Indicate that there is no high contrast available */
426 lpHighContrastA->dwFlags = 0;
427 lpHighContrastA->lpszDefaultScheme = NULL;
435 WINE_SPI_FIXME(SPI_SETHIGHCONTRAST); /* 67 WINVER >= 0x400 */
437 WINE_SPI_FIXME(SPI_GETKEYBOARDPREF); /* 68 WINVER >= 0x400 */
438 WINE_SPI_FIXME(SPI_SETKEYBOARDPREF); /* 69 WINVER >= 0x400 */
440 WINE_SPI_FIXME(SPI_GETSCREENREADER); /* 70 WINVER >= 0x400 */
441 WINE_SPI_FIXME(SPI_SETSCREENREADER); /* 71 WINVER >= 0x400 */
443 case SPI_GETANIMATION: /* 72 WINVER >= 0x400 */
445 LPANIMATIONINFO lpAnimInfo = (LPANIMATIONINFO)pvParam;
447 /* Tell it "disabled" */
448 if (lpAnimInfo->cbSize == sizeof(ANIMATIONINFO))
449 lpAnimInfo->iMinAnimate = 0; /* Minimise and restore animation is disabled (nonzero == enabled) */
454 WINE_SPI_WARN(SPI_SETANIMATION); /* 73 WINVER >= 0x400 */
456 WINE_SPI_FIXME(SPI_GETFONTSMOOTHING); /* 74 WINVER >= 0x400 */
457 WINE_SPI_FIXME(SPI_SETFONTSMOOTHING); /* 75 WINVER >= 0x400 */
459 WINE_SPI_FIXME(SPI_SETDRAGWIDTH); /* 76 WINVER >= 0x400 */
460 WINE_SPI_FIXME(SPI_SETDRAGHEIGHT); /* 77 WINVER >= 0x400 */
462 WINE_SPI_FIXME(SPI_SETHANDHELD); /* 78 WINVER >= 0x400 */
464 WINE_SPI_FIXME(SPI_GETLOWPOWERTIMEOUT); /* 79 WINVER >= 0x400 */
465 WINE_SPI_FIXME(SPI_GETPOWEROFFTIMEOUT); /* 80 WINVER >= 0x400 */
466 WINE_SPI_FIXME(SPI_SETLOWPOWERTIMEOUT); /* 81 WINVER >= 0x400 */
467 WINE_SPI_FIXME(SPI_SETPOWEROFFTIMEOUT); /* 82 WINVER >= 0x400 */
468 WINE_SPI_FIXME(SPI_GETLOWPOWERACTIVE); /* 83 WINVER >= 0x400 */
469 WINE_SPI_FIXME(SPI_GETPOWEROFFACTIVE); /* 84 WINVER >= 0x400 */
470 WINE_SPI_FIXME(SPI_SETLOWPOWERACTIVE); /* 85 WINVER >= 0x400 */
471 WINE_SPI_FIXME(SPI_SETPOWEROFFACTIVE); /* 86 WINVER >= 0x400 */
473 WINE_SPI_FIXME(SPI_SETCURSORS); /* 87 WINVER >= 0x400 */
474 WINE_SPI_FIXME(SPI_SETICONS); /* 88 WINVER >= 0x400 */
476 WINE_SPI_FIXME(SPI_GETDEFAULTINPUTLANG); /* 89 WINVER >= 0x400 */
477 WINE_SPI_FIXME(SPI_SETDEFAULTINPUTLANG); /* 90 WINVER >= 0x400 */
479 WINE_SPI_FIXME(SPI_SETLANGTOGGLE); /* 91 WINVER >= 0x400 */
481 case SPI_GETWINDOWSEXTENSION: /* 92 WINVER >= 0x400 */
482 WARN("pretend no support for Win9x Plus! for now.\n");
483 ret = FALSE; /* yes, this is the result value */
486 WINE_SPI_FIXME(SPI_SETMOUSETRAILS); /* 93 WINVER >= 0x400 */
487 WINE_SPI_FIXME(SPI_GETMOUSETRAILS); /* 94 WINVER >= 0x400 */
489 WINE_SPI_FIXME(SPI_SETSCREENSAVERRUNNING); /* 97 WINVER >= 0x400 */
490 /* SPI_SCREENSAVERRUNNING is an alias for SPI_SETSCREENSAVERRUNNING */
492 case SPI_GETMOUSEHOVERWIDTH: /* 98 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
493 *(UINT *)pvParam = 4;
495 WINE_SPI_FIXME(SPI_SETMOUSEHOVERWIDTH); /* 99 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
497 case SPI_GETMOUSEHOVERHEIGHT: /* 100 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
498 *(UINT *)pvParam = 4;
500 WINE_SPI_FIXME(SPI_SETMOUSEHOVERHEIGHT); /* 101 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
502 case SPI_GETMOUSEHOVERTIME: /* 102 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
503 *(UINT *)pvParam = 400; /* default for menu dropdowns */
505 WINE_SPI_FIXME(SPI_SETMOUSEHOVERTIME); /* 103 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
507 case SPI_GETWHEELSCROLLLINES: /* 104 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
508 *(UINT *)pvParam = 3; /* default for num scroll lines */
511 WINE_SPI_FIXME(SPI_SETWHEELSCROLLLINES); /* 105 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
513 case SPI_GETMENUSHOWDELAY: /* 106 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
514 *(UINT *)pvParam = 400; /* Tested against Windows NT 4.0 and Windows 2000 */
517 WINE_SPI_FIXME(SPI_GETSHOWIMEUI); /* 110 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
518 WINE_SPI_FIXME(SPI_SETSHOWIMEUI); /* 111 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
521 FIXME( "Unknown action: %u\n", uiAction );
522 SetLastError( ERROR_INVALID_SPI_VALUE );
529 #undef WINE_SPI_FIXME
534 /***********************************************************************
535 * SystemParametersInfo (USER.483)
537 BOOL16 WINAPI SystemParametersInfo16( UINT16 uAction, UINT16 uParam,
538 LPVOID lpvParam, UINT16 fuWinIni )
542 TRACE("(%u, %u, %p, %u)\n", uAction, uParam, lpvParam, fuWinIni);
546 case SPI_GETBEEP: /* 1 */
547 case SPI_GETSCREENSAVEACTIVE: /* 16 */
548 case SPI_GETICONTITLEWRAP: /* 25 */
549 case SPI_GETMENUDROPALIGNMENT: /* 27 */
550 case SPI_GETFASTTASKSWITCH: /* 35 */
551 case SPI_GETDRAGFULLWINDOWS: /* 38 WINVER >= 0x0400 */
554 ret = SystemParametersInfoA( uAction, uParam, lpvParam ? &tmp : NULL, fuWinIni );
556 *(BOOL16 *)lpvParam = tmp;
560 case SPI_GETBORDER: /* 5 */
561 case SPI_ICONHORIZONTALSPACING: /* 13 */
562 case SPI_GETSCREENSAVETIMEOUT: /* 14 */
563 case SPI_GETGRIDGRANULARITY: /* 18 */
564 case SPI_GETKEYBOARDDELAY: /* 22 */
565 case SPI_ICONVERTICALSPACING: /* 24 */
568 ret = SystemParametersInfoA( uAction, uParam, lpvParam ? &tmp : NULL, fuWinIni );
570 *(INT16 *)lpvParam = tmp;
574 case SPI_GETKEYBOARDSPEED: /* 10 */
577 ret = SystemParametersInfoA( uAction, uParam, lpvParam ? &tmp : NULL, fuWinIni );
579 *(WORD *)lpvParam = tmp;
583 case SPI_GETICONTITLELOGFONT: /* 31 */
586 ret = SystemParametersInfoA( uAction, uParam, lpvParam ? &tmp : NULL, fuWinIni );
588 SYSPARAMS_LogFont32ATo16( &tmp, (LPLOGFONT16)lpvParam );
592 case SPI_GETNONCLIENTMETRICS: /* 41 WINVER >= 0x400 */
594 NONCLIENTMETRICSA tmp;
595 LPNONCLIENTMETRICS16 lpnm16 = (LPNONCLIENTMETRICS16)lpvParam;
596 if (lpnm16 && lpnm16->cbSize == sizeof(NONCLIENTMETRICS16))
598 tmp.cbSize = sizeof(NONCLIENTMETRICSA);
599 ret = SystemParametersInfoA( uAction, uParam, &tmp, fuWinIni );
601 SYSPARAMS_NonClientMetrics32ATo16( &tmp, lpnm16 );
603 else /* winfile 95 sets cbSize to 340 */
604 ret = SystemParametersInfoA( uAction, uParam, lpvParam, fuWinIni );
608 case SPI_GETWORKAREA: /* 48 WINVER >= 0x400 */
611 ret = SystemParametersInfoA( uAction, uParam, lpvParam ? &tmp : NULL, fuWinIni );
613 CONV_RECT32TO16( &tmp, (RECT16 *)lpvParam );
617 case SPI_GETMOUSEHOVERWIDTH: /* 98 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
618 case SPI_GETMOUSEHOVERHEIGHT: /* 100 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
619 case SPI_GETMOUSEHOVERTIME: /* 102 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
622 ret = SystemParametersInfoA( uAction, uParam, lpvParam ? &tmp : NULL, fuWinIni );
624 *(UINT16 *)lpvParam = tmp;
629 ret = SystemParametersInfoA( uAction, uParam, lpvParam, fuWinIni );
635 /***********************************************************************
636 * SystemParametersInfoW (USER32.@)
638 BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
639 PVOID pvParam, UINT fuWinIni )
643 TRACE("(%u, %u, %p, %u)\n", uiAction, uiParam, pvParam, fuWinIni);
647 case SPI_SETDESKWALLPAPER: /* 20 */
648 case SPI_SETDESKPATTERN: /* 21 */
652 if (!WideCharToMultiByte( CP_ACP, 0, (LPWSTR)pvParam, -1,
653 buffer, sizeof(buffer), NULL, NULL ))
654 buffer[sizeof(buffer)-1] = 0;
655 ret = SystemParametersInfoA( uiAction, uiParam, pvParam ? buffer : NULL, fuWinIni );
659 case SPI_GETICONTITLELOGFONT: /* 31 */
662 ret = SystemParametersInfoA( uiAction, uiParam, pvParam ? &tmp : NULL, fuWinIni );
664 SYSPARAMS_LogFont32ATo32W( &tmp, (LPLOGFONTW)pvParam );
668 case SPI_GETNONCLIENTMETRICS: /* 41 WINVER >= 0x400 */
670 NONCLIENTMETRICSA tmp;
671 LPNONCLIENTMETRICSW lpnmW = (LPNONCLIENTMETRICSW)pvParam;
672 if (lpnmW && lpnmW->cbSize == sizeof(NONCLIENTMETRICSW))
674 tmp.cbSize = sizeof(NONCLIENTMETRICSA);
675 ret = SystemParametersInfoA( uiAction, uiParam, &tmp, fuWinIni );
677 SYSPARAMS_NonClientMetrics32ATo32W( &tmp, lpnmW );
684 case SPI_GETICONMETRICS: /* 45 WINVER >= 0x400 */
687 LPICONMETRICSW lpimW = (LPICONMETRICSW)pvParam;
688 if (lpimW && lpimW->cbSize == sizeof(ICONMETRICSW))
690 tmp.cbSize = sizeof(ICONMETRICSA);
691 ret = SystemParametersInfoA( uiAction, uiParam, &tmp, fuWinIni );
694 lpimW->iHorzSpacing = tmp.iHorzSpacing;
695 lpimW->iVertSpacing = tmp.iVertSpacing;
696 lpimW->iTitleWrap = tmp.iTitleWrap;
697 SYSPARAMS_LogFont32ATo32W( &tmp.lfFont, &lpimW->lfFont );
705 case SPI_GETHIGHCONTRAST: /* 66 WINVER >= 0x400 */
708 LPHIGHCONTRASTW lphcW = (LPHIGHCONTRASTW)pvParam;
709 if (lphcW && lphcW->cbSize == sizeof(HIGHCONTRASTW))
711 tmp.cbSize = sizeof(HIGHCONTRASTA);
712 ret = SystemParametersInfoA( uiAction, uiParam, &tmp, fuWinIni );
715 lphcW->dwFlags = tmp.dwFlags;
716 lphcW->lpszDefaultScheme = NULL; /* FIXME? */
725 ret = SystemParametersInfoA( uiAction, uiParam, pvParam, fuWinIni );