2 * System parameters functions
4 * Copyright 1994 Alexandre Julliard
16 #include "wine/winuser16.h"
22 #include "debugtools.h"
24 DEFAULT_DEBUG_CHANNEL(system
);
26 /***********************************************************************
27 * GetTimerResolution (USER.14)
29 LONG WINAPI
GetTimerResolution16(void)
34 /***********************************************************************
35 * ControlPanelInfo (USER.273)
37 void WINAPI
ControlPanelInfo16( INT16 nInfoType
, WORD wData
, LPSTR lpBuffer
)
39 FIXME("(%d, %04x, %p): stub.\n", nInfoType
, wData
, lpBuffer
);
42 /* This function is a copy of the one in objects/font.c */
43 static void SYSPARAMS_LogFont32ATo16( const LOGFONTA
* font32
, LPLOGFONT16 font16
)
45 font16
->lfHeight
= font32
->lfHeight
;
46 font16
->lfWidth
= font32
->lfWidth
;
47 font16
->lfEscapement
= font32
->lfEscapement
;
48 font16
->lfOrientation
= font32
->lfOrientation
;
49 font16
->lfWeight
= font32
->lfWeight
;
50 font16
->lfItalic
= font32
->lfItalic
;
51 font16
->lfUnderline
= font32
->lfUnderline
;
52 font16
->lfStrikeOut
= font32
->lfStrikeOut
;
53 font16
->lfCharSet
= font32
->lfCharSet
;
54 font16
->lfOutPrecision
= font32
->lfOutPrecision
;
55 font16
->lfClipPrecision
= font32
->lfClipPrecision
;
56 font16
->lfQuality
= font32
->lfQuality
;
57 font16
->lfPitchAndFamily
= font32
->lfPitchAndFamily
;
58 lstrcpynA( font16
->lfFaceName
, font32
->lfFaceName
, LF_FACESIZE
);
61 static void SYSPARAMS_LogFont32ATo32W( const LOGFONTA
* font32A
, LPLOGFONTW font32W
)
63 font32W
->lfHeight
= font32A
->lfHeight
;
64 font32W
->lfWidth
= font32A
->lfWidth
;
65 font32W
->lfEscapement
= font32A
->lfEscapement
;
66 font32W
->lfOrientation
= font32A
->lfOrientation
;
67 font32W
->lfWeight
= font32A
->lfWeight
;
68 font32W
->lfItalic
= font32A
->lfItalic
;
69 font32W
->lfUnderline
= font32A
->lfUnderline
;
70 font32W
->lfStrikeOut
= font32A
->lfStrikeOut
;
71 font32W
->lfCharSet
= font32A
->lfCharSet
;
72 font32W
->lfOutPrecision
= font32A
->lfOutPrecision
;
73 font32W
->lfClipPrecision
= font32A
->lfClipPrecision
;
74 font32W
->lfQuality
= font32A
->lfQuality
;
75 font32W
->lfPitchAndFamily
= font32A
->lfPitchAndFamily
;
76 MultiByteToWideChar( CP_ACP
, 0, font32A
->lfFaceName
, -1, font32W
->lfFaceName
, LF_FACESIZE
);
77 font32W
->lfFaceName
[LF_FACESIZE
-1] = 0;
80 static void SYSPARAMS_NonClientMetrics32ATo16( const NONCLIENTMETRICSA
* lpnm32
, LPNONCLIENTMETRICS16 lpnm16
)
82 lpnm16
->iBorderWidth
= lpnm32
->iBorderWidth
;
83 lpnm16
->iScrollWidth
= lpnm32
->iScrollWidth
;
84 lpnm16
->iScrollHeight
= lpnm32
->iScrollHeight
;
85 lpnm16
->iCaptionWidth
= lpnm32
->iCaptionWidth
;
86 lpnm16
->iCaptionHeight
= lpnm32
->iCaptionHeight
;
87 SYSPARAMS_LogFont32ATo16( &lpnm32
->lfCaptionFont
, &lpnm16
->lfCaptionFont
);
88 lpnm16
->iSmCaptionWidth
= lpnm32
->iSmCaptionWidth
;
89 lpnm16
->iSmCaptionHeight
= lpnm32
->iSmCaptionHeight
;
90 SYSPARAMS_LogFont32ATo16( &lpnm32
->lfSmCaptionFont
, &lpnm16
->lfSmCaptionFont
);
91 lpnm16
->iMenuWidth
= lpnm32
->iMenuWidth
;
92 lpnm16
->iMenuHeight
= lpnm32
->iMenuHeight
;
93 SYSPARAMS_LogFont32ATo16( &lpnm32
->lfMenuFont
, &lpnm16
->lfMenuFont
);
94 SYSPARAMS_LogFont32ATo16( &lpnm32
->lfStatusFont
, &lpnm16
->lfStatusFont
);
95 SYSPARAMS_LogFont32ATo16( &lpnm32
->lfMessageFont
, &lpnm16
->lfMessageFont
);
98 static void SYSPARAMS_NonClientMetrics32ATo32W( const NONCLIENTMETRICSA
* lpnm32A
, LPNONCLIENTMETRICSW lpnm32W
)
100 lpnm32W
->iBorderWidth
= lpnm32A
->iBorderWidth
;
101 lpnm32W
->iScrollWidth
= lpnm32A
->iScrollWidth
;
102 lpnm32W
->iScrollHeight
= lpnm32A
->iScrollHeight
;
103 lpnm32W
->iCaptionWidth
= lpnm32A
->iCaptionWidth
;
104 lpnm32W
->iCaptionHeight
= lpnm32A
->iCaptionHeight
;
105 SYSPARAMS_LogFont32ATo32W( &lpnm32A
->lfCaptionFont
, &lpnm32W
->lfCaptionFont
);
106 lpnm32W
->iSmCaptionWidth
= lpnm32A
->iSmCaptionWidth
;
107 lpnm32W
->iSmCaptionHeight
= lpnm32A
->iSmCaptionHeight
;
108 SYSPARAMS_LogFont32ATo32W( &lpnm32A
->lfSmCaptionFont
, &lpnm32W
->lfSmCaptionFont
);
109 lpnm32W
->iMenuWidth
= lpnm32A
->iMenuWidth
;
110 lpnm32W
->iMenuHeight
= lpnm32A
->iMenuHeight
;
111 SYSPARAMS_LogFont32ATo32W( &lpnm32A
->lfMenuFont
, &lpnm32W
->lfMenuFont
);
112 SYSPARAMS_LogFont32ATo32W( &lpnm32A
->lfStatusFont
, &lpnm32W
->lfStatusFont
);
113 SYSPARAMS_LogFont32ATo32W( &lpnm32A
->lfMessageFont
, &lpnm32W
->lfMessageFont
);
116 /***********************************************************************
117 * SystemParametersInfoA (USER32.@)
119 BOOL WINAPI
SystemParametersInfoA( UINT uiAction
, UINT uiParam
,
120 PVOID pvParam
, UINT fWinIni
)
122 #define WINE_SPI_FIXME(x) \
124 FIXME( "Unimplemented action: %u (%s)\n", x, #x ); \
125 SetLastError( ERROR_INVALID_SPI_VALUE ); \
128 #define WINE_SPI_WARN(x) \
130 WARN( "Ignored action: %u (%s)\n", x, #x ); \
135 TRACE("(%u, %u, %p, %u)\n", uiAction
, uiParam
, pvParam
, fWinIni
);
139 case SPI_GETBEEP
: /* 1 */
140 *(BOOL
*)pvParam
= KEYBOARD_GetBeepActive();
142 case SPI_SETBEEP
: /* 2 */
143 KEYBOARD_SetBeepActive( uiParam
);
146 WINE_SPI_FIXME(SPI_GETMOUSE
); /* 3 */
147 WINE_SPI_FIXME(SPI_SETMOUSE
); /* 4 */
149 case SPI_GETBORDER
: /* 5 */
150 *(INT
*)pvParam
= GetSystemMetrics( SM_CXFRAME
);
152 WINE_SPI_WARN(SPI_SETBORDER
); /* 6 */
154 case SPI_GETKEYBOARDSPEED
: /* 10 */
155 *(DWORD
*)pvParam
= GetProfileIntA( "keyboard", "KeyboardSpeed", 30 );
157 WINE_SPI_WARN(SPI_SETKEYBOARDSPEED
); /* 11 */
159 WINE_SPI_WARN(SPI_LANGDRIVER
); /* 12 */
161 case SPI_ICONHORIZONTALSPACING
: /* 13 */
162 /* FIXME Get/SetProfileInt */
164 /*SetSystemMetrics( SM_CXICONSPACING, uiParam )*/ ;
166 *(INT
*)pvParam
= GetSystemMetrics( SM_CXICONSPACING
);
169 case SPI_GETSCREENSAVETIMEOUT
: /* 14 */
172 timeout
= USER_Driver
.pGetScreenSaveTimeout();
174 timeout
= GetProfileIntA( "windows", "ScreenSaveTimeout", 300 );
175 *(INT
*)pvParam
= timeout
;
178 case SPI_SETSCREENSAVETIMEOUT
: /* 15 */
179 USER_Driver
.pSetScreenSaveTimeout( uiParam
);
182 case SPI_GETSCREENSAVEACTIVE
: /* 16 */
183 if (USER_Driver
.pGetScreenSaveActive() ||
184 GetProfileIntA( "windows", "ScreenSaveActive", 1 ) == 1)
185 *(BOOL
*)pvParam
= TRUE
;
187 *(BOOL
*)pvParam
= FALSE
;
189 case SPI_SETSCREENSAVEACTIVE
: /* 17 */
190 USER_Driver
.pSetScreenSaveActive( uiParam
);
193 case SPI_GETGRIDGRANULARITY
: /* 18 */
194 *(INT
*)pvParam
= GetProfileIntA( "desktop", "GridGranularity", 1 );
196 WINE_SPI_FIXME(SPI_SETGRIDGRANULARITY
); /* 19 */
198 case SPI_SETDESKWALLPAPER
: /* 20 */
199 ret
= SetDeskWallPaper( (LPSTR
)pvParam
);
201 case SPI_SETDESKPATTERN
: /* 21 */
202 /* FIXME: the ability to specify a pattern in pvParam
203 doesn't seem to be documented for Win32 */
204 if ((INT16
)uiParam
== -1)
207 GetProfileStringA( "Desktop", "Pattern",
208 "170 85 170 85 170 85 170 85",
209 buffer
, sizeof(buffer
) );
210 ret
= DESKTOP_SetPattern( (LPSTR
)buffer
);
212 ret
= DESKTOP_SetPattern( (LPSTR
)pvParam
);
215 case SPI_GETKEYBOARDDELAY
: /* 22 */
216 *(INT
*)pvParam
= GetProfileIntA( "keyboard", "KeyboardDelay", 1 );
218 WINE_SPI_WARN(SPI_SETKEYBOARDDELAY
); /* 23 */
220 case SPI_ICONVERTICALSPACING
: /* 24 */
221 /* FIXME Get/SetProfileInt */
223 /*SetSystemMetrics( SM_CYICONSPACING, uiParam )*/ ;
225 *(INT
*)pvParam
= GetSystemMetrics( SM_CYICONSPACING
);
228 case SPI_GETICONTITLEWRAP
: /* 25 */
229 *(BOOL
*)pvParam
= GetProfileIntA( "desktop", "IconTitleWrap", TRUE
);
231 WINE_SPI_FIXME(SPI_SETICONTITLEWRAP
); /* 26 */
233 case SPI_GETMENUDROPALIGNMENT
: /* 27 */
234 *(BOOL
*)pvParam
= GetSystemMetrics( SM_MENUDROPALIGNMENT
); /* XXX check this */
236 WINE_SPI_FIXME(SPI_SETMENUDROPALIGNMENT
); /* 28 */
238 WINE_SPI_WARN(SPI_SETDOUBLECLKWIDTH
); /* 29 */
239 WINE_SPI_WARN(SPI_SETDOUBLECLKHEIGHT
); /* 30 */
241 case SPI_GETICONTITLELOGFONT
: /* 31 */
243 LPLOGFONTA lpLogFont
= (LPLOGFONTA
)pvParam
;
245 /* from now on we always have an alias for MS Sans Serif */
247 GetProfileStringA( "Desktop", "IconTitleFaceName", "MS Sans Serif",
248 lpLogFont
->lfFaceName
, LF_FACESIZE
);
249 lpLogFont
->lfHeight
= -GetProfileIntA( "Desktop", "IconTitleSize", 13 );
250 lpLogFont
->lfWidth
= 0;
251 lpLogFont
->lfEscapement
= lpLogFont
->lfOrientation
= 0;
252 lpLogFont
->lfWeight
= FW_NORMAL
;
253 lpLogFont
->lfItalic
= FALSE
;
254 lpLogFont
->lfStrikeOut
= FALSE
;
255 lpLogFont
->lfUnderline
= FALSE
;
256 lpLogFont
->lfCharSet
= ANSI_CHARSET
;
257 lpLogFont
->lfOutPrecision
= OUT_DEFAULT_PRECIS
;
258 lpLogFont
->lfClipPrecision
= CLIP_DEFAULT_PRECIS
;
259 lpLogFont
->lfPitchAndFamily
= DEFAULT_PITCH
| FF_SWISS
;
263 WINE_SPI_WARN(SPI_SETDOUBLECLICKTIME
); /* 32 */
265 WINE_SPI_FIXME(SPI_SETMOUSEBUTTONSWAP
); /* 33 */
266 WINE_SPI_FIXME(SPI_SETICONTITLELOGFONT
); /* 34 */
268 case SPI_GETFASTTASKSWITCH
: /* 35 */
269 if (GetProfileIntA( "windows", "CoolSwitch", 1 ) == 1)
270 *(BOOL
*)pvParam
= TRUE
;
272 *(BOOL
*)pvParam
= FALSE
;
274 WINE_SPI_WARN(SPI_SETFASTTASKSWITCH
); /* 36 */
276 WINE_SPI_WARN(SPI_SETDRAGFULLWINDOWS
); /* 37 WINVER >= 0x0400 */
277 case SPI_GETDRAGFULLWINDOWS
: /* 38 WINVER >= 0x0400 */
281 DWORD dwBufferSize
= sizeof(buffer
);
283 *(BOOL
*)pvParam
= FALSE
;
284 if (RegOpenKeyExA( HKEY_CURRENT_USER
,
285 "Control Panel\\desktop",
286 0, KEY_QUERY_VALUE
, &hKey
) == ERROR_SUCCESS
)
288 if (RegQueryValueExA( hKey
, "DragFullWindows", NULL
,
289 0, buffer
, &dwBufferSize
) == ERROR_SUCCESS
)
290 *(BOOL
*)pvParam
= atoi( buffer
) != 0;
297 case SPI_GETNONCLIENTMETRICS
: /* 41 WINVER >= 0x400 */
299 LPNONCLIENTMETRICSA lpnm
= (LPNONCLIENTMETRICSA
)pvParam
;
301 if (lpnm
->cbSize
== sizeof(NONCLIENTMETRICSA
))
303 LPLOGFONTA lpLogFont
= &(lpnm
->lfMenuFont
);
305 /* clear the struct, so we have 'sane' members */
307 (char *)pvParam
+ sizeof(lpnm
->cbSize
),
309 lpnm
->cbSize
- sizeof(lpnm
->cbSize
)
312 /* FIXME: initialize geometry entries */
313 /* FIXME: As these values are presumably in device units,
314 * we should calculate the defaults based on the screen dpi
317 lpnm
->iCaptionWidth
= ((TWEAK_WineLook
> WIN31_LOOK
) ? 32 : 20);
318 lpnm
->iCaptionHeight
= lpnm
->iCaptionWidth
;
319 SystemParametersInfoA( SPI_GETICONTITLELOGFONT
, 0, (LPVOID
)&(lpnm
->lfCaptionFont
), 0 );
320 lpnm
->lfCaptionFont
.lfWeight
= FW_BOLD
;
323 lpnm
->iSmCaptionWidth
= ((TWEAK_WineLook
> WIN31_LOOK
) ? 32 : 17);
324 lpnm
->iSmCaptionHeight
= lpnm
->iSmCaptionWidth
;
325 SystemParametersInfoA( SPI_GETICONTITLELOGFONT
, 0, (LPVOID
)&(lpnm
->lfSmCaptionFont
), 0 );
327 /* menus, FIXME: names of wine.conf entrys are bogus */
329 lpnm
->iMenuWidth
= GetProfileIntA( "Desktop", "MenuWidth", 13 ); /* size of the menu buttons*/
330 lpnm
->iMenuHeight
= GetProfileIntA( "Desktop", "MenuHeight",
331 (TWEAK_WineLook
> WIN31_LOOK
) ? 13 : 27 );
333 GetProfileStringA( "Desktop", "MenuFont",
334 (TWEAK_WineLook
> WIN31_LOOK
) ? "MS Sans Serif": "System",
335 lpLogFont
->lfFaceName
, LF_FACESIZE
);
337 lpLogFont
->lfHeight
= -GetProfileIntA( "Desktop", "MenuFontSize", 13 );
338 lpLogFont
->lfWidth
= 0;
339 lpLogFont
->lfEscapement
= lpLogFont
->lfOrientation
= 0;
340 lpLogFont
->lfWeight
= (TWEAK_WineLook
> WIN31_LOOK
) ? FW_NORMAL
: FW_BOLD
;
341 lpLogFont
->lfItalic
= FALSE
;
342 lpLogFont
->lfStrikeOut
= FALSE
;
343 lpLogFont
->lfUnderline
= FALSE
;
344 lpLogFont
->lfCharSet
= ANSI_CHARSET
;
345 lpLogFont
->lfOutPrecision
= OUT_DEFAULT_PRECIS
;
346 lpLogFont
->lfClipPrecision
= CLIP_DEFAULT_PRECIS
;
347 lpLogFont
->lfPitchAndFamily
= DEFAULT_PITCH
| FF_SWISS
;
349 SystemParametersInfoA( SPI_GETICONTITLELOGFONT
, 0,
350 (LPVOID
)&(lpnm
->lfStatusFont
), 0 );
351 SystemParametersInfoA( SPI_GETICONTITLELOGFONT
, 0,
352 (LPVOID
)&(lpnm
->lfMessageFont
), 0 );
356 WARN("size mismatch !! (is %d; should be %d)\n", lpnm
->cbSize
, sizeof(NONCLIENTMETRICSA
));
357 /* FIXME: SetLastError? */
362 WINE_SPI_FIXME(SPI_SETNONCLIENTMETRICS
); /* 42 WINVER >= 0x400 */
364 WINE_SPI_FIXME(SPI_GETMINIMIZEDMETRICS
); /* 43 WINVER >= 0x400 */
365 WINE_SPI_FIXME(SPI_SETMINIMIZEDMETRICS
); /* 44 WINVER >= 0x400 */
367 case SPI_GETICONMETRICS
: /* 45 WINVER >= 0x400 */
369 LPICONMETRICSA lpIcon
= pvParam
;
370 if(lpIcon
&& lpIcon
->cbSize
== sizeof(*lpIcon
))
372 SystemParametersInfoA( SPI_ICONHORIZONTALSPACING
, 0,
373 &lpIcon
->iHorzSpacing
, FALSE
);
374 SystemParametersInfoA( SPI_ICONVERTICALSPACING
, 0,
375 &lpIcon
->iVertSpacing
, FALSE
);
376 SystemParametersInfoA( SPI_GETICONTITLEWRAP
, 0,
377 &lpIcon
->iTitleWrap
, FALSE
);
378 SystemParametersInfoA( SPI_GETICONTITLELOGFONT
, 0,
379 &lpIcon
->lfFont
, FALSE
);
387 WINE_SPI_FIXME(SPI_SETICONMETRICS
); /* 46 WINVER >= 0x400 */
389 WINE_SPI_FIXME(SPI_SETWORKAREA
); /* 47 WINVER >= 0x400 */
390 case SPI_GETWORKAREA
: /* 48 WINVER >= 0x400 */
391 SetRect( (RECT
*)pvParam
, 0, 0,
392 GetSystemMetrics( SM_CXSCREEN
),
393 GetSystemMetrics( SM_CYSCREEN
) );
396 WINE_SPI_FIXME(SPI_SETPENWINDOWS
); /* 49 WINVER >= 0x400 */
398 WINE_SPI_FIXME(SPI_GETFILTERKEYS
); /* 50 */
399 WINE_SPI_FIXME(SPI_SETFILTERKEYS
); /* 51 */
400 WINE_SPI_FIXME(SPI_GETTOGGLEKEYS
); /* 52 */
401 WINE_SPI_FIXME(SPI_SETTOGGLEKEYS
); /* 53 */
402 WINE_SPI_FIXME(SPI_GETMOUSEKEYS
); /* 54 */
403 WINE_SPI_FIXME(SPI_SETMOUSEKEYS
); /* 55 */
404 WINE_SPI_FIXME(SPI_GETSHOWSOUNDS
); /* 56 */
405 WINE_SPI_FIXME(SPI_SETSHOWSOUNDS
); /* 57 */
406 WINE_SPI_FIXME(SPI_GETSTICKYKEYS
); /* 58 */
407 WINE_SPI_FIXME(SPI_SETSTICKYKEYS
); /* 59 */
408 WINE_SPI_FIXME(SPI_GETACCESSTIMEOUT
); /* 60 */
409 WINE_SPI_FIXME(SPI_SETACCESSTIMEOUT
); /* 61 */
411 WINE_SPI_FIXME(SPI_GETSERIALKEYS
); /* 62 WINVER >= 0x400 */
412 WINE_SPI_FIXME(SPI_SETSERIALKEYS
); /* 63 WINVER >= 0x400 */
414 WINE_SPI_FIXME(SPI_GETSOUNDSENTRY
); /* 64 */
415 WINE_SPI_FIXME(SPI_SETSOUNDSENTRY
); /* 65 */
417 case SPI_GETHIGHCONTRAST
: /* 66 WINVER >= 0x400 */
419 LPHIGHCONTRASTA lpHighContrastA
= (LPHIGHCONTRASTA
)pvParam
;
420 WARN("SPI_GETHIGHCONTRAST not fully implemented\n");
421 if (lpHighContrastA
->cbSize
== sizeof(HIGHCONTRASTA
))
423 /* Indicate that there is no high contrast available */
424 lpHighContrastA
->dwFlags
= 0;
425 lpHighContrastA
->lpszDefaultScheme
= NULL
;
433 WINE_SPI_FIXME(SPI_SETHIGHCONTRAST
); /* 67 WINVER >= 0x400 */
435 WINE_SPI_FIXME(SPI_GETKEYBOARDPREF
); /* 68 WINVER >= 0x400 */
436 WINE_SPI_FIXME(SPI_SETKEYBOARDPREF
); /* 69 WINVER >= 0x400 */
438 WINE_SPI_FIXME(SPI_GETSCREENREADER
); /* 70 WINVER >= 0x400 */
439 WINE_SPI_FIXME(SPI_SETSCREENREADER
); /* 71 WINVER >= 0x400 */
441 case SPI_GETANIMATION
: /* 72 WINVER >= 0x400 */
443 LPANIMATIONINFO lpAnimInfo
= (LPANIMATIONINFO
)pvParam
;
445 /* Tell it "disabled" */
446 if (lpAnimInfo
->cbSize
== sizeof(ANIMATIONINFO
))
447 lpAnimInfo
->iMinAnimate
= 0; /* Minimise and restore animation is disabled (nonzero == enabled) */
452 WINE_SPI_WARN(SPI_SETANIMATION
); /* 73 WINVER >= 0x400 */
454 WINE_SPI_FIXME(SPI_GETFONTSMOOTHING
); /* 74 WINVER >= 0x400 */
455 WINE_SPI_FIXME(SPI_SETFONTSMOOTHING
); /* 75 WINVER >= 0x400 */
457 WINE_SPI_FIXME(SPI_SETDRAGWIDTH
); /* 76 WINVER >= 0x400 */
458 WINE_SPI_FIXME(SPI_SETDRAGHEIGHT
); /* 77 WINVER >= 0x400 */
460 WINE_SPI_FIXME(SPI_SETHANDHELD
); /* 78 WINVER >= 0x400 */
462 WINE_SPI_FIXME(SPI_GETLOWPOWERTIMEOUT
); /* 79 WINVER >= 0x400 */
463 WINE_SPI_FIXME(SPI_GETPOWEROFFTIMEOUT
); /* 80 WINVER >= 0x400 */
464 WINE_SPI_FIXME(SPI_SETLOWPOWERTIMEOUT
); /* 81 WINVER >= 0x400 */
465 WINE_SPI_FIXME(SPI_SETPOWEROFFTIMEOUT
); /* 82 WINVER >= 0x400 */
466 WINE_SPI_FIXME(SPI_GETLOWPOWERACTIVE
); /* 83 WINVER >= 0x400 */
467 WINE_SPI_FIXME(SPI_GETPOWEROFFACTIVE
); /* 84 WINVER >= 0x400 */
468 WINE_SPI_FIXME(SPI_SETLOWPOWERACTIVE
); /* 85 WINVER >= 0x400 */
469 WINE_SPI_FIXME(SPI_SETPOWEROFFACTIVE
); /* 86 WINVER >= 0x400 */
471 WINE_SPI_FIXME(SPI_SETCURSORS
); /* 87 WINVER >= 0x400 */
472 WINE_SPI_FIXME(SPI_SETICONS
); /* 88 WINVER >= 0x400 */
474 WINE_SPI_FIXME(SPI_GETDEFAULTINPUTLANG
); /* 89 WINVER >= 0x400 */
475 WINE_SPI_FIXME(SPI_SETDEFAULTINPUTLANG
); /* 90 WINVER >= 0x400 */
477 WINE_SPI_FIXME(SPI_SETLANGTOGGLE
); /* 91 WINVER >= 0x400 */
479 case SPI_GETWINDOWSEXTENSION
: /* 92 WINVER >= 0x400 */
480 WARN("pretend no support for Win9x Plus! for now.\n");
481 ret
= FALSE
; /* yes, this is the result value */
484 WINE_SPI_FIXME(SPI_SETMOUSETRAILS
); /* 93 WINVER >= 0x400 */
485 WINE_SPI_FIXME(SPI_GETMOUSETRAILS
); /* 94 WINVER >= 0x400 */
487 WINE_SPI_FIXME(SPI_SETSCREENSAVERRUNNING
); /* 97 WINVER >= 0x400 */
488 /* SPI_SCREENSAVERRUNNING is an alias for SPI_SETSCREENSAVERRUNNING */
490 case SPI_GETMOUSEHOVERWIDTH
: /* 98 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
491 *(UINT
*)pvParam
= 4;
493 WINE_SPI_FIXME(SPI_SETMOUSEHOVERWIDTH
); /* 99 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
495 case SPI_GETMOUSEHOVERHEIGHT
: /* 100 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
496 *(UINT
*)pvParam
= 4;
498 WINE_SPI_FIXME(SPI_SETMOUSEHOVERHEIGHT
); /* 101 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
500 case SPI_GETMOUSEHOVERTIME
: /* 102 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
501 *(UINT
*)pvParam
= 400; /* default for menu dropdowns */
503 WINE_SPI_FIXME(SPI_SETMOUSEHOVERTIME
); /* 103 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
505 case SPI_GETWHEELSCROLLLINES
: /* 104 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
506 *(UINT
*)pvParam
= 3; /* default for num scroll lines */
509 WINE_SPI_FIXME(SPI_SETWHEELSCROLLLINES
); /* 105 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
511 case SPI_GETMENUSHOWDELAY
: /* 106 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
512 *(UINT
*)pvParam
= 400; /* Tested against Windows NT 4.0 and Windows 2000 */
515 WINE_SPI_FIXME(SPI_GETSHOWIMEUI
); /* 110 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
516 WINE_SPI_FIXME(SPI_SETSHOWIMEUI
); /* 111 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
519 FIXME( "Unknown action: %u\n", uiAction
);
520 SetLastError( ERROR_INVALID_SPI_VALUE
);
527 #undef WINE_SPI_FIXME
532 /***********************************************************************
533 * SystemParametersInfo (USER.483)
535 BOOL16 WINAPI
SystemParametersInfo16( UINT16 uAction
, UINT16 uParam
,
536 LPVOID lpvParam
, UINT16 fuWinIni
)
540 TRACE("(%u, %u, %p, %u)\n", uAction
, uParam
, lpvParam
, fuWinIni
);
544 case SPI_GETBEEP
: /* 1 */
545 case SPI_GETSCREENSAVEACTIVE
: /* 16 */
546 case SPI_GETICONTITLEWRAP
: /* 25 */
547 case SPI_GETMENUDROPALIGNMENT
: /* 27 */
548 case SPI_GETFASTTASKSWITCH
: /* 35 */
549 case SPI_GETDRAGFULLWINDOWS
: /* 38 WINVER >= 0x0400 */
552 ret
= SystemParametersInfoA( uAction
, uParam
, lpvParam
? &tmp
: NULL
, fuWinIni
);
554 *(BOOL16
*)lpvParam
= tmp
;
558 case SPI_GETBORDER
: /* 5 */
559 case SPI_ICONHORIZONTALSPACING
: /* 13 */
560 case SPI_GETSCREENSAVETIMEOUT
: /* 14 */
561 case SPI_GETGRIDGRANULARITY
: /* 18 */
562 case SPI_GETKEYBOARDDELAY
: /* 22 */
563 case SPI_ICONVERTICALSPACING
: /* 24 */
566 ret
= SystemParametersInfoA( uAction
, uParam
, lpvParam
? &tmp
: NULL
, fuWinIni
);
568 *(INT16
*)lpvParam
= tmp
;
572 case SPI_GETKEYBOARDSPEED
: /* 10 */
575 ret
= SystemParametersInfoA( uAction
, uParam
, lpvParam
? &tmp
: NULL
, fuWinIni
);
577 *(WORD
*)lpvParam
= tmp
;
581 case SPI_GETICONTITLELOGFONT
: /* 31 */
584 ret
= SystemParametersInfoA( uAction
, uParam
, lpvParam
? &tmp
: NULL
, fuWinIni
);
586 SYSPARAMS_LogFont32ATo16( &tmp
, (LPLOGFONT16
)lpvParam
);
590 case SPI_GETNONCLIENTMETRICS
: /* 41 WINVER >= 0x400 */
592 NONCLIENTMETRICSA tmp
;
593 LPNONCLIENTMETRICS16 lpnm16
= (LPNONCLIENTMETRICS16
)lpvParam
;
594 if (lpnm16
&& lpnm16
->cbSize
== sizeof(NONCLIENTMETRICS16
))
596 tmp
.cbSize
= sizeof(NONCLIENTMETRICSA
);
597 ret
= SystemParametersInfoA( uAction
, uParam
, &tmp
, fuWinIni
);
599 SYSPARAMS_NonClientMetrics32ATo16( &tmp
, lpnm16
);
601 else /* winfile 95 sets cbSize to 340 */
602 ret
= SystemParametersInfoA( uAction
, uParam
, lpvParam
, fuWinIni
);
606 case SPI_GETWORKAREA
: /* 48 WINVER >= 0x400 */
609 ret
= SystemParametersInfoA( uAction
, uParam
, lpvParam
? &tmp
: NULL
, fuWinIni
);
611 CONV_RECT32TO16( &tmp
, (RECT16
*)lpvParam
);
615 case SPI_GETMOUSEHOVERWIDTH
: /* 98 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
616 case SPI_GETMOUSEHOVERHEIGHT
: /* 100 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
617 case SPI_GETMOUSEHOVERTIME
: /* 102 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
620 ret
= SystemParametersInfoA( uAction
, uParam
, lpvParam
? &tmp
: NULL
, fuWinIni
);
622 *(UINT16
*)lpvParam
= tmp
;
627 ret
= SystemParametersInfoA( uAction
, uParam
, lpvParam
, fuWinIni
);
633 /***********************************************************************
634 * SystemParametersInfoW (USER32.@)
636 BOOL WINAPI
SystemParametersInfoW( UINT uiAction
, UINT uiParam
,
637 PVOID pvParam
, UINT fuWinIni
)
641 TRACE("(%u, %u, %p, %u)\n", uiAction
, uiParam
, pvParam
, fuWinIni
);
645 case SPI_SETDESKWALLPAPER
: /* 20 */
646 case SPI_SETDESKPATTERN
: /* 21 */
650 if (!WideCharToMultiByte( CP_ACP
, 0, (LPWSTR
)pvParam
, -1,
651 buffer
, sizeof(buffer
), NULL
, NULL
))
652 buffer
[sizeof(buffer
)-1] = 0;
653 ret
= SystemParametersInfoA( uiAction
, uiParam
, pvParam
? buffer
: NULL
, fuWinIni
);
657 case SPI_GETICONTITLELOGFONT
: /* 31 */
660 ret
= SystemParametersInfoA( uiAction
, uiParam
, pvParam
? &tmp
: NULL
, fuWinIni
);
662 SYSPARAMS_LogFont32ATo32W( &tmp
, (LPLOGFONTW
)pvParam
);
666 case SPI_GETNONCLIENTMETRICS
: /* 41 WINVER >= 0x400 */
668 NONCLIENTMETRICSA tmp
;
669 LPNONCLIENTMETRICSW lpnmW
= (LPNONCLIENTMETRICSW
)pvParam
;
670 if (lpnmW
&& lpnmW
->cbSize
== sizeof(NONCLIENTMETRICSW
))
672 tmp
.cbSize
= sizeof(NONCLIENTMETRICSA
);
673 ret
= SystemParametersInfoA( uiAction
, uiParam
, &tmp
, fuWinIni
);
675 SYSPARAMS_NonClientMetrics32ATo32W( &tmp
, lpnmW
);
682 case SPI_GETICONMETRICS
: /* 45 WINVER >= 0x400 */
685 LPICONMETRICSW lpimW
= (LPICONMETRICSW
)pvParam
;
686 if (lpimW
&& lpimW
->cbSize
== sizeof(ICONMETRICSW
))
688 tmp
.cbSize
= sizeof(ICONMETRICSA
);
689 ret
= SystemParametersInfoA( uiAction
, uiParam
, &tmp
, fuWinIni
);
692 lpimW
->iHorzSpacing
= tmp
.iHorzSpacing
;
693 lpimW
->iVertSpacing
= tmp
.iVertSpacing
;
694 lpimW
->iTitleWrap
= tmp
.iTitleWrap
;
695 SYSPARAMS_LogFont32ATo32W( &tmp
.lfFont
, &lpimW
->lfFont
);
703 case SPI_GETHIGHCONTRAST
: /* 66 WINVER >= 0x400 */
706 LPHIGHCONTRASTW lphcW
= (LPHIGHCONTRASTW
)pvParam
;
707 if (lphcW
&& lphcW
->cbSize
== sizeof(HIGHCONTRASTW
))
709 tmp
.cbSize
= sizeof(HIGHCONTRASTA
);
710 ret
= SystemParametersInfoA( uiAction
, uiParam
, &tmp
, fuWinIni
);
713 lphcW
->dwFlags
= tmp
.dwFlags
;
714 lphcW
->lpszDefaultScheme
= NULL
; /* FIXME? */
723 ret
= SystemParametersInfoA( uiAction
, uiParam
, pvParam
, fuWinIni
);