2 * System parameters functions
4 * Copyright 1994 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 #include "wine/winuser16.h"
36 #include "wine/debug.h"
38 WINE_DEFAULT_DEBUG_CHANNEL(system);
40 /* System parameter indexes */
41 #define SPI_SETBEEP_IDX 0
42 #define SPI_SETMOUSE_IDX 1
43 #define SPI_SETBORDER_IDX 2
44 #define SPI_SETKEYBOARDSPEED_IDX 3
45 #define SPI_ICONHORIZONTALSPACING_IDX 4
46 #define SPI_SETSCREENSAVETIMEOUT_IDX 5
47 #define SPI_SETGRIDGRANULARITY_IDX 6
48 #define SPI_SETKEYBOARDDELAY_IDX 7
49 #define SPI_ICONVERTICALSPACING_IDX 8
50 #define SPI_SETICONTITLEWRAP_IDX 9
51 #define SPI_SETMENUDROPALIGNMENT_IDX 10
52 #define SPI_SETDOUBLECLKWIDTH_IDX 11
53 #define SPI_SETDOUBLECLKHEIGHT_IDX 12
54 #define SPI_SETDOUBLECLICKTIME_IDX 13
55 #define SPI_SETMOUSEBUTTONSWAP_IDX 14
56 #define SPI_SETDRAGFULLWINDOWS_IDX 15
57 #define SPI_SETWORKAREA_IDX 16
58 #define SPI_SETSHOWSOUNDS_IDX 17
59 #define SPI_SETKEYBOARDPREF_IDX 18
60 #define SPI_SETSCREENREADER_IDX 19
61 #define SPI_SETSCREENSAVERRUNNING_IDX 20
62 #define SPI_WINE_IDX SPI_SETSCREENSAVERRUNNING_IDX
65 * Names of the registry subkeys of HKEY_CURRENT_USER key and value names
66 * for the system parameters.
67 * Names of the keys are created by adding string "_REGKEY" to
68 * "SET" action names, value names are created by adding "_REG_NAME"
69 * to the "SET" action name.
71 #define SPI_SETBEEP_REGKEY "Control Panel\\Sound"
72 #define SPI_SETBEEP_VALNAME "Beep"
73 #define SPI_SETMOUSE_REGKEY "Control Panel\\Mouse"
74 #define SPI_SETMOUSE_VALNAME1 "MouseThreshold1"
75 #define SPI_SETMOUSE_VALNAME2 "MouseThreshold2"
76 #define SPI_SETMOUSE_VALNAME3 "MouseSpeed"
77 #define SPI_SETBORDER_REGKEY "Control Panel\\Desktop"
78 #define SPI_SETBORDER_VALNAME "BorderWidth"
79 #define SPI_SETKEYBOARDSPEED_REGKEY "Control Panel\\Keyboard"
80 #define SPI_SETKEYBOARDSPEED_VALNAME "KeyboardSpeed"
81 #define SPI_ICONHORIZONTALSPACING_REGKEY "Control Panel\\Desktop\\WindowMetrics"
82 #define SPI_ICONHORIZONTALSPACING_VALNAME "IconSpacing"
83 #define SPI_SETSCREENSAVETIMEOUT_REGKEY "Control Panel\\Desktop"
84 #define SPI_SETSCREENSAVETIMEOUT_VALNAME "ScreenSaveTimeOut"
85 #define SPI_SETSCREENSAVEACTIVE_REGKEY "Control Panel\\Desktop"
86 #define SPI_SETSCREENSAVEACTIVE_VALNAME "ScreenSaveActive"
87 #define SPI_SETGRIDGRANULARITY_REGKEY "Control Panel\\Desktop"
88 #define SPI_SETGRIDGRANULARITY_VALNAME "GridGranularity"
89 #define SPI_SETKEYBOARDDELAY_REGKEY "Control Panel\\Keyboard"
90 #define SPI_SETKEYBOARDDELAY_VALNAME "KeyboardDelay"
91 #define SPI_ICONVERTICALSPACING_REGKEY "Control Panel\\Desktop\\WindowMetrics"
92 #define SPI_ICONVERTICALSPACING_VALNAME "IconVerticalSpacing"
93 #define SPI_SETICONTITLEWRAP_REGKEY1 "Control Panel\\Desktop\\WindowMetrics"
94 #define SPI_SETICONTITLEWRAP_REGKEY2 "Control Panel\\Desktop"
95 #define SPI_SETICONTITLEWRAP_VALNAME "IconTitleWrap"
96 #define SPI_SETMENUDROPALIGNMENT_REGKEY1 "Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows"
97 #define SPI_SETMENUDROPALIGNMENT_REGKEY2 "Control Panel\\Desktop"
98 #define SPI_SETMENUDROPALIGNMENT_VALNAME "MenuDropAlignment"
99 #define SPI_SETDOUBLECLKWIDTH_REGKEY1 "Control Panel\\Mouse"
100 #define SPI_SETDOUBLECLKWIDTH_REGKEY2 "Control Panel\\Desktop"
101 #define SPI_SETDOUBLECLKWIDTH_VALNAME "DoubleClickWidth"
102 #define SPI_SETDOUBLECLKHEIGHT_REGKEY1 "Control Panel\\Mouse"
103 #define SPI_SETDOUBLECLKHEIGHT_REGKEY2 "Control Panel\\Desktop"
104 #define SPI_SETDOUBLECLKHEIGHT_VALNAME "DoubleClickHeight"
105 #define SPI_SETDOUBLECLICKTIME_REGKEY "Control Panel\\Mouse"
106 #define SPI_SETDOUBLECLICKTIME_VALNAME "DoubleClickSpeed"
107 #define SPI_SETMOUSEBUTTONSWAP_REGKEY "Control Panel\\Mouse"
108 #define SPI_SETMOUSEBUTTONSWAP_VALNAME "SwapMouseButtons"
109 #define SPI_SETDRAGFULLWINDOWS_REGKEY "Control Panel\\Desktop"
110 #define SPI_SETDRAGFULLWINDOWS_VALNAME "DragFullWindows"
111 #define SPI_SETWORKAREA_REGKEY "Control Panel\\Desktop"
112 #define SPI_SETWORKAREA_VALNAME "WINE_WorkArea"
113 #define SPI_SETSHOWSOUNDS_REGKEY "Control Panel\\Accessibility\\ShowSounds"
114 #define SPI_SETSHOWSOUNDS_VALNAME "On"
115 #define SPI_SETDESKWALLPAPER_REGKEY "Control Panel\\Desktop"
116 #define SPI_SETDESKWALLPAPER_VALNAME "Wallpaper"
117 /* FIXME - real values */
118 #define SPI_SETKEYBOARDPREF_REGKEY "Control Panel\\Desktop"
119 #define SPI_SETKEYBOARDPREF_VALNAME "WINE_KeyboardPref"
120 #define SPI_SETSCREENREADER_REGKEY "Control Panel\\Desktop"
121 #define SPI_SETSCREENREADER_VALNAME "WINE_ScreenReader"
122 #define SPI_SETSCREENSAVERRUNNING_REGKEY "Control Panel\\Desktop"
123 #define SPI_SETSCREENSAVERRUNNING_VALNAME "WINE_ScreenSaverRunning"
125 /* volatile registry branch under CURRENT_USER_REGKEY for temporary values storage */
126 #define WINE_CURRENT_USER_REGKEY "Wine"
128 /* Indicators whether system parameter value is loaded */
129 static char spi_loaded[SPI_WINE_IDX + 1];
131 static BOOL notify_change = TRUE;
133 /* System parameters storage */
134 static BOOL beep_active = TRUE;
135 static int mouse_threshold1 = 6;
136 static int mouse_threshold2 = 10;
137 static int mouse_speed = 1;
138 static int border = 1;
139 static int keyboard_speed = 31;
140 static int screensave_timeout = 300;
141 static int grid_granularity = 0;
142 static int keyboard_delay = 1;
143 static BOOL icon_title_wrap = TRUE;
144 static int double_click_time = 500;
145 static BOOL drag_full_windows = FALSE;
146 static RECT work_area;
147 static BOOL keyboard_pref = TRUE;
148 static BOOL screen_reader = FALSE;
149 static BOOL screensaver_running = FALSE;
151 /***********************************************************************
152 * GetTimerResolution (USER.14)
154 LONG WINAPI GetTimerResolution16(void)
159 /***********************************************************************
160 * ControlPanelInfo (USER.273)
162 void WINAPI ControlPanelInfo16( INT16 nInfoType, WORD wData, LPSTR lpBuffer )
164 FIXME("(%d, %04x, %p): stub.\n", nInfoType, wData, lpBuffer);
167 /* This function is a copy of the one in objects/font.c */
168 static void SYSPARAMS_LogFont32ATo16( const LOGFONTA* font32, LPLOGFONT16 font16 )
170 font16->lfHeight = font32->lfHeight;
171 font16->lfWidth = font32->lfWidth;
172 font16->lfEscapement = font32->lfEscapement;
173 font16->lfOrientation = font32->lfOrientation;
174 font16->lfWeight = font32->lfWeight;
175 font16->lfItalic = font32->lfItalic;
176 font16->lfUnderline = font32->lfUnderline;
177 font16->lfStrikeOut = font32->lfStrikeOut;
178 font16->lfCharSet = font32->lfCharSet;
179 font16->lfOutPrecision = font32->lfOutPrecision;
180 font16->lfClipPrecision = font32->lfClipPrecision;
181 font16->lfQuality = font32->lfQuality;
182 font16->lfPitchAndFamily = font32->lfPitchAndFamily;
183 lstrcpynA( font16->lfFaceName, font32->lfFaceName, LF_FACESIZE );
186 static void SYSPARAMS_LogFont32ATo32W( const LOGFONTA* font32A, LPLOGFONTW font32W )
188 font32W->lfHeight = font32A->lfHeight;
189 font32W->lfWidth = font32A->lfWidth;
190 font32W->lfEscapement = font32A->lfEscapement;
191 font32W->lfOrientation = font32A->lfOrientation;
192 font32W->lfWeight = font32A->lfWeight;
193 font32W->lfItalic = font32A->lfItalic;
194 font32W->lfUnderline = font32A->lfUnderline;
195 font32W->lfStrikeOut = font32A->lfStrikeOut;
196 font32W->lfCharSet = font32A->lfCharSet;
197 font32W->lfOutPrecision = font32A->lfOutPrecision;
198 font32W->lfClipPrecision = font32A->lfClipPrecision;
199 font32W->lfQuality = font32A->lfQuality;
200 font32W->lfPitchAndFamily = font32A->lfPitchAndFamily;
201 MultiByteToWideChar( CP_ACP, 0, font32A->lfFaceName, -1, font32W->lfFaceName, LF_FACESIZE );
202 font32W->lfFaceName[LF_FACESIZE-1] = 0;
205 static void SYSPARAMS_NonClientMetrics32ATo16( const NONCLIENTMETRICSA* lpnm32, LPNONCLIENTMETRICS16 lpnm16 )
207 lpnm16->iBorderWidth = lpnm32->iBorderWidth;
208 lpnm16->iScrollWidth = lpnm32->iScrollWidth;
209 lpnm16->iScrollHeight = lpnm32->iScrollHeight;
210 lpnm16->iCaptionWidth = lpnm32->iCaptionWidth;
211 lpnm16->iCaptionHeight = lpnm32->iCaptionHeight;
212 SYSPARAMS_LogFont32ATo16( &lpnm32->lfCaptionFont, &lpnm16->lfCaptionFont );
213 lpnm16->iSmCaptionWidth = lpnm32->iSmCaptionWidth;
214 lpnm16->iSmCaptionHeight = lpnm32->iSmCaptionHeight;
215 SYSPARAMS_LogFont32ATo16( &lpnm32->lfSmCaptionFont, &lpnm16->lfSmCaptionFont );
216 lpnm16->iMenuWidth = lpnm32->iMenuWidth;
217 lpnm16->iMenuHeight = lpnm32->iMenuHeight;
218 SYSPARAMS_LogFont32ATo16( &lpnm32->lfMenuFont, &lpnm16->lfMenuFont );
219 SYSPARAMS_LogFont32ATo16( &lpnm32->lfStatusFont, &lpnm16->lfStatusFont );
220 SYSPARAMS_LogFont32ATo16( &lpnm32->lfMessageFont, &lpnm16->lfMessageFont );
223 static void SYSPARAMS_NonClientMetrics32ATo32W( const NONCLIENTMETRICSA* lpnm32A, LPNONCLIENTMETRICSW lpnm32W )
225 lpnm32W->iBorderWidth = lpnm32A->iBorderWidth;
226 lpnm32W->iScrollWidth = lpnm32A->iScrollWidth;
227 lpnm32W->iScrollHeight = lpnm32A->iScrollHeight;
228 lpnm32W->iCaptionWidth = lpnm32A->iCaptionWidth;
229 lpnm32W->iCaptionHeight = lpnm32A->iCaptionHeight;
230 SYSPARAMS_LogFont32ATo32W( &lpnm32A->lfCaptionFont, &lpnm32W->lfCaptionFont );
231 lpnm32W->iSmCaptionWidth = lpnm32A->iSmCaptionWidth;
232 lpnm32W->iSmCaptionHeight = lpnm32A->iSmCaptionHeight;
233 SYSPARAMS_LogFont32ATo32W( &lpnm32A->lfSmCaptionFont, &lpnm32W->lfSmCaptionFont );
234 lpnm32W->iMenuWidth = lpnm32A->iMenuWidth;
235 lpnm32W->iMenuHeight = lpnm32A->iMenuHeight;
236 SYSPARAMS_LogFont32ATo32W( &lpnm32A->lfMenuFont, &lpnm32W->lfMenuFont );
237 SYSPARAMS_LogFont32ATo32W( &lpnm32A->lfStatusFont, &lpnm32W->lfStatusFont );
238 SYSPARAMS_LogFont32ATo32W( &lpnm32A->lfMessageFont, &lpnm32W->lfMessageFont );
241 /***********************************************************************
244 * Sets the system parameter which should be always loaded to
245 * current value stored in registry.
246 * Invalidates lazy loaded parameter, so it will be loaded the next time
250 * uiAction - system parameter to reload value for.
251 * Note, only "SET" values can be used for this parameter.
252 * If uiAction is 0 all system parameters are reset.
254 void SYSPARAMS_Reset( UINT uiAction )
256 #define WINE_RELOAD_SPI(x) \
258 spi_loaded[x##_IDX] = FALSE; \
259 SystemParametersInfoA( x, 0, dummy_buf, 0 );\
263 #define WINE_IGNORE_SPI(x) \
268 #define WINE_INVALIDATE_SPI(x) \
270 spi_loaded[x##_IDX] = FALSE; \
273 BOOL not_all_processed = TRUE;
276 /* Execution falls through all the branches for uiAction == 0 */
280 memset( spi_loaded, 0, sizeof(spi_loaded) );
282 WINE_RELOAD_SPI(SPI_SETBORDER);
283 WINE_RELOAD_SPI(SPI_ICONHORIZONTALSPACING);
284 WINE_RELOAD_SPI(SPI_ICONVERTICALSPACING);
285 WINE_IGNORE_SPI(SPI_SETSCREENSAVEACTIVE);
286 WINE_RELOAD_SPI(SPI_SETDOUBLECLKWIDTH);
287 WINE_RELOAD_SPI(SPI_SETDOUBLECLKHEIGHT);
288 WINE_RELOAD_SPI(SPI_SETMOUSEBUTTONSWAP);
289 WINE_RELOAD_SPI(SPI_SETSHOWSOUNDS);
290 WINE_RELOAD_SPI(SPI_SETMENUDROPALIGNMENT);
295 /* lazy loaded parameters */
298 WINE_INVALIDATE_SPI(SPI_SETBEEP);
299 WINE_INVALIDATE_SPI(SPI_SETMOUSE);
300 WINE_INVALIDATE_SPI(SPI_SETKEYBOARDSPEED);
301 WINE_INVALIDATE_SPI(SPI_SETSCREENSAVETIMEOUT);
302 WINE_INVALIDATE_SPI(SPI_SETGRIDGRANULARITY);
303 WINE_INVALIDATE_SPI(SPI_SETKEYBOARDDELAY);
304 WINE_INVALIDATE_SPI(SPI_SETICONTITLEWRAP);
305 WINE_INVALIDATE_SPI(SPI_SETDOUBLECLICKTIME);
306 WINE_INVALIDATE_SPI(SPI_SETDRAGFULLWINDOWS);
307 WINE_INVALIDATE_SPI(SPI_SETWORKAREA);
308 WINE_INVALIDATE_SPI(SPI_SETKEYBOARDPREF);
309 WINE_INVALIDATE_SPI(SPI_SETSCREENREADER);
310 WINE_INVALIDATE_SPI(SPI_SETSCREENSAVERRUNNING);
312 FIXME( "Unknown action reset: %u\n", uiAction );
317 not_all_processed = FALSE;
321 if (!uiAction && not_all_processed)
322 ERR( "Incorrect implementation of SYSPARAMS_Reset. "
323 "Not all params are reloaded.\n" );
324 #undef WINE_INVALIDATE_SPI
325 #undef WINE_IGNORE_SPI
326 #undef WINE_RELOAD_SPI
329 /***********************************************************************
330 * get_volatile_regkey
332 * Return a handle to the volatile registry key used to store
333 * non-permanently modified parameters.
335 static HKEY get_volatile_regkey(void)
337 static HKEY volatile_key;
341 if (RegCreateKeyExA( HKEY_CURRENT_USER, WINE_CURRENT_USER_REGKEY,
342 0, 0, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, 0,
343 &volatile_key, 0 ) != ERROR_SUCCESS)
344 ERR("Can't create wine configuration registry branch\n");
349 /***********************************************************************
350 * SYSPARAMS_NotifyChange
352 * Sends notification about system parameter update.
354 void SYSPARAMS_NotifyChange( UINT uiAction, UINT fWinIni )
358 if (fWinIni & SPIF_UPDATEINIFILE)
360 if (fWinIni & (SPIF_SENDWININICHANGE | SPIF_SENDCHANGE))
361 SendMessageA(HWND_BROADCAST, WM_SETTINGCHANGE,
362 uiAction, (LPARAM) "");
366 /* FIXME notify other wine processes with internal message */
372 /***********************************************************************
373 * Loads system parameter from user profile.
375 BOOL SYSPARAMS_Load( LPSTR lpRegKey, LPSTR lpValName, LPSTR lpBuf )
382 if ((RegOpenKeyA( get_volatile_regkey(), lpRegKey,
383 &hKey ) == ERROR_SUCCESS) ||
384 (RegOpenKeyA( HKEY_CURRENT_USER, lpRegKey,
385 &hKey ) == ERROR_SUCCESS))
387 ret = !RegQueryValueExA( hKey, lpValName, NULL, &type, lpBuf, &count );
393 /***********************************************************************
394 * Saves system parameter to user profile.
396 BOOL SYSPARAMS_Save( LPSTR lpRegKey, LPSTR lpValName, LPSTR lpValue,
404 if (fWinIni & SPIF_UPDATEINIFILE)
406 hBaseKey = HKEY_CURRENT_USER;
411 hBaseKey = get_volatile_regkey();
412 dwOptions = REG_OPTION_VOLATILE;
415 if (RegCreateKeyExA( hBaseKey, lpRegKey,
416 0, 0, dwOptions, KEY_ALL_ACCESS,
417 0, &hKey, 0 ) == ERROR_SUCCESS)
419 if (RegSetValueExA( hKey, lpValName, 0, REG_SZ,
420 lpValue, strlen(lpValue) + 1 ) == ERROR_SUCCESS)
423 if (hBaseKey == HKEY_CURRENT_USER)
424 RegDeleteKeyA( get_volatile_regkey(), lpRegKey );
432 /***********************************************************************
433 * SYSPARAMS_GetDoubleClickSize
435 * There is no SPI_GETDOUBLECLK* so we export this function instead.
437 void SYSPARAMS_GetDoubleClickSize( INT *width, INT *height )
441 if (!spi_loaded[SPI_SETDOUBLECLKWIDTH_IDX])
445 if (SYSPARAMS_Load( SPI_SETDOUBLECLKWIDTH_REGKEY1,
446 SPI_SETDOUBLECLKWIDTH_VALNAME, buf ))
448 SYSMETRICS_Set( SM_CXDOUBLECLK, atoi( buf ) );
450 spi_loaded[SPI_SETDOUBLECLKWIDTH_IDX] = TRUE;
452 if (!spi_loaded[SPI_SETDOUBLECLKHEIGHT_IDX])
454 if (SYSPARAMS_Load( SPI_SETDOUBLECLKHEIGHT_REGKEY1,
455 SPI_SETDOUBLECLKHEIGHT_VALNAME, buf ))
457 SYSMETRICS_Set( SM_CYDOUBLECLK, atoi( buf ) );
459 spi_loaded[SPI_SETDOUBLECLKHEIGHT_IDX] = TRUE;
461 *width = GetSystemMetrics( SM_CXDOUBLECLK );
462 *height = GetSystemMetrics( SM_CYDOUBLECLK );
466 /***********************************************************************
467 * SYSPARAMS_GetMouseButtonSwap
469 * There is no SPI_GETMOUSEBUTTONSWAP so we export this function instead.
471 INT SYSPARAMS_GetMouseButtonSwap( void )
473 int spi_idx = SPI_SETMOUSEBUTTONSWAP_IDX;
475 if (!spi_loaded[spi_idx])
479 if (SYSPARAMS_Load( SPI_SETMOUSEBUTTONSWAP_REGKEY,
480 SPI_SETMOUSEBUTTONSWAP_VALNAME, buf ))
482 SYSMETRICS_Set( SM_SWAPBUTTON, atoi( buf ) );
484 spi_loaded[spi_idx] = TRUE;
487 return GetSystemMetrics( SM_SWAPBUTTON );
490 /***********************************************************************
492 * SYSPARAMS_GetGUIFont
494 * fills LOGFONT with 'default GUI font'.
497 static void SYSPARAMS_GetGUIFont( LOGFONTA* plf )
501 memset( plf, 0, sizeof(LOGFONTA) );
502 hf = (HFONT)GetStockObject( DEFAULT_GUI_FONT );
503 if ( GetObjectA( hf, sizeof(LOGFONTA), plf ) != sizeof(LOGFONTA) )
506 * GetObjectA() would be succeeded always
507 * since this is a stock object
509 ERR("GetObjectA() failed\n");
513 /* copied from GetSystemMetrics()'s RegistryTwips2Pixels() */
514 inline static int SYSPARAMS_Twips2Pixels(int x)
521 /***********************************************************************
522 * SystemParametersInfoA (USER32.@)
524 * Each system parameter has flag which shows whether the parameter
525 * is loaded or not. Parameters, stored directly in SysParametersInfo are
526 * loaded from registry only when they are requested and the flag is
527 * "false", after the loading the flag is set to "true". On interprocess
528 * notification of the parameter change the corresponding parameter flag is
529 * set to "false". The parameter value will be reloaded when it is requested
531 * Parameters, backed by or depend on GetSystemMetrics are processed
532 * differently. These parameters are always loaded. They are reloaded right
533 * away on interprocess change notification. We can't do lazy loading because
534 * we don't want to complicate GetSystemMetrics.
535 * Parameters, backed by X settings are read from corresponding setting.
536 * On the parameter change request the setting is changed. Interprocess change
537 * notifications are ignored.
538 * When parameter value is updated the changed value is stored in permanent
539 * registry branch if saving is requested. Otherwise it is stored
540 * in temporary branch
542 * Some SPI values can also be stored as Twips values in the registry,
543 * don't forget the conversion!
545 BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam,
546 PVOID pvParam, UINT fWinIni )
548 #define WINE_SPI_FIXME(x) \
550 FIXME( "Unimplemented action: %u (%s)\n", x, #x ); \
551 SetLastError( ERROR_INVALID_SPI_VALUE ); \
554 #define WINE_SPI_WARN(x) \
556 WARN( "Ignored action: %u (%s)\n", x, #x ); \
560 unsigned spi_idx = 0;
562 TRACE("(%u, %u, %p, %u)\n", uiAction, uiParam, pvParam, fWinIni);
566 case SPI_GETBEEP: /* 1 */
567 spi_idx = SPI_SETBEEP_IDX;
568 if (!spi_loaded[spi_idx])
572 if (SYSPARAMS_Load( SPI_SETBEEP_REGKEY, SPI_SETBEEP_VALNAME, buf ))
573 beep_active = !strcasecmp( "Yes", buf );
574 spi_loaded[spi_idx] = TRUE;
577 *(BOOL *)pvParam = beep_active;
580 case SPI_SETBEEP: /* 2 */
581 spi_idx = SPI_SETBEEP_IDX;
582 if (SYSPARAMS_Save( SPI_SETBEEP_REGKEY, SPI_SETBEEP_VALNAME,
583 (uiParam ? "Yes" : "No"), fWinIni ))
585 beep_active = uiParam;
586 spi_loaded[spi_idx] = TRUE;
592 case SPI_GETMOUSE: /* 3 */
593 spi_idx = SPI_SETMOUSE_IDX;
594 if (!spi_loaded[spi_idx])
598 if (SYSPARAMS_Load( SPI_SETMOUSE_REGKEY, SPI_SETMOUSE_VALNAME1,
600 mouse_threshold1 = atoi( buf );
601 if (SYSPARAMS_Load( SPI_SETMOUSE_REGKEY, SPI_SETMOUSE_VALNAME2,
603 mouse_threshold2 = atoi( buf );
604 if (SYSPARAMS_Load( SPI_SETMOUSE_REGKEY, SPI_SETMOUSE_VALNAME3,
606 mouse_speed = atoi( buf );
607 spi_loaded[spi_idx] = TRUE;
609 ((INT *)pvParam)[0] = mouse_threshold1;
610 ((INT *)pvParam)[1] = mouse_threshold2;
611 ((INT *)pvParam)[2] = mouse_speed;
614 case SPI_SETMOUSE: /* 4 */
618 spi_idx = SPI_SETMOUSE_IDX;
619 sprintf(buf, "%d", ((INT *)pvParam)[0]);
621 if (SYSPARAMS_Save( SPI_SETMOUSE_REGKEY, SPI_SETMOUSE_VALNAME1,
624 mouse_threshold1 = ((INT *)pvParam)[0];
625 spi_loaded[spi_idx] = TRUE;
627 sprintf(buf, "%d", ((INT *)pvParam)[1]);
628 SYSPARAMS_Save( SPI_SETMOUSE_REGKEY, SPI_SETMOUSE_VALNAME2,
630 mouse_threshold2 = ((INT *)pvParam)[1];
632 sprintf(buf, "%d", ((INT *)pvParam)[2]);
633 SYSPARAMS_Save( SPI_SETMOUSE_REGKEY, SPI_SETMOUSE_VALNAME3,
635 mouse_speed = ((INT *)pvParam)[2];
642 case SPI_GETBORDER: /* 5 */
643 spi_idx = SPI_SETBORDER_IDX;
644 if (!spi_loaded[spi_idx])
648 if (SYSPARAMS_Load( SPI_SETBORDER_REGKEY, SPI_SETBORDER_VALNAME, buf ))
649 border = SYSPARAMS_Twips2Pixels( atoi(buf) );
651 spi_loaded[spi_idx] = TRUE;
652 if (TWEAK_WineLook > WIN31_LOOK)
654 SYSMETRICS_Set( SM_CXFRAME, border + GetSystemMetrics( SM_CXDLGFRAME ) );
655 SYSMETRICS_Set( SM_CYFRAME, border + GetSystemMetrics( SM_CXDLGFRAME ) );
658 *(INT *)pvParam = border;
661 case SPI_SETBORDER: /* 6 */
665 spi_idx = SPI_SETBORDER_IDX;
666 sprintf(buf, "%u", uiParam);
668 if (SYSPARAMS_Save( SPI_SETBORDER_REGKEY, SPI_SETBORDER_VALNAME,
674 spi_loaded[spi_idx] = TRUE;
675 if (TWEAK_WineLook > WIN31_LOOK)
677 SYSMETRICS_Set( SM_CXFRAME, uiParam + GetSystemMetrics( SM_CXDLGFRAME ) );
678 SYSMETRICS_Set( SM_CYFRAME, uiParam + GetSystemMetrics( SM_CXDLGFRAME ) );
687 case SPI_GETKEYBOARDSPEED: /* 10 */
688 spi_idx = SPI_SETKEYBOARDSPEED_IDX;
689 if (!spi_loaded[spi_idx])
693 if (SYSPARAMS_Load( SPI_SETKEYBOARDSPEED_REGKEY,
694 SPI_SETKEYBOARDSPEED_VALNAME,
696 keyboard_speed = atoi( buf );
697 spi_loaded[spi_idx] = TRUE;
699 *(INT *)pvParam = keyboard_speed;
702 case SPI_SETKEYBOARDSPEED: /* 11 */
706 spi_idx = SPI_SETKEYBOARDSPEED_IDX;
709 sprintf(buf, "%u", uiParam);
711 if (SYSPARAMS_Save( SPI_SETKEYBOARDSPEED_REGKEY,
712 SPI_SETKEYBOARDSPEED_VALNAME,
715 keyboard_speed = uiParam;
716 spi_loaded[spi_idx] = TRUE;
723 /* not implemented in Windows */
724 WINE_SPI_WARN(SPI_LANGDRIVER); /* 12 */
726 case SPI_ICONHORIZONTALSPACING: /* 13 */
727 spi_idx = SPI_ICONHORIZONTALSPACING_IDX;
730 if (!spi_loaded[spi_idx])
735 if (SYSPARAMS_Load( SPI_ICONHORIZONTALSPACING_REGKEY,
736 SPI_ICONHORIZONTALSPACING_VALNAME, buf ))
738 val = SYSPARAMS_Twips2Pixels( atoi(buf) );
739 SYSMETRICS_Set( SM_CXICONSPACING, val );
741 spi_loaded[spi_idx] = TRUE;
744 *(INT *)pvParam = GetSystemMetrics( SM_CXICONSPACING );
750 if (uiParam < 32) uiParam = 32;
752 sprintf(buf, "%u", uiParam);
753 if (SYSPARAMS_Save( SPI_ICONHORIZONTALSPACING_REGKEY,
754 SPI_ICONHORIZONTALSPACING_VALNAME,
757 SYSMETRICS_Set( SM_CXICONSPACING, uiParam );
758 spi_loaded[spi_idx] = TRUE;
765 case SPI_GETSCREENSAVETIMEOUT: /* 14 */
766 spi_idx = SPI_SETSCREENSAVETIMEOUT_IDX;
767 if (!spi_loaded[spi_idx])
771 if (SYSPARAMS_Load( SPI_SETSCREENSAVETIMEOUT_REGKEY,
772 SPI_SETSCREENSAVETIMEOUT_VALNAME,
774 screensave_timeout = atoi( buf );
776 spi_loaded[spi_idx] = TRUE;
778 *(INT *)pvParam = screensave_timeout;
781 case SPI_SETSCREENSAVETIMEOUT: /* 15 */
785 spi_idx = SPI_SETSCREENSAVETIMEOUT_IDX;
786 sprintf(buf, "%u", uiParam);
788 if (SYSPARAMS_Save( SPI_SETSCREENSAVETIMEOUT_REGKEY,
789 SPI_SETSCREENSAVETIMEOUT_VALNAME,
792 screensave_timeout = uiParam;
793 spi_loaded[spi_idx] = TRUE;
800 case SPI_GETSCREENSAVEACTIVE: /* 16 */
801 *(BOOL *)pvParam = USER_Driver.pGetScreenSaveActive();
804 case SPI_SETSCREENSAVEACTIVE: /* 17 */
808 sprintf(buf, "%u", uiParam);
809 USER_Driver.pSetScreenSaveActive( uiParam );
810 /* saved value does not affect Wine */
811 SYSPARAMS_Save( SPI_SETSCREENSAVEACTIVE_REGKEY,
812 SPI_SETSCREENSAVEACTIVE_VALNAME,
817 case SPI_GETGRIDGRANULARITY: /* 18 */
818 spi_idx = SPI_SETGRIDGRANULARITY_IDX;
819 if (!spi_loaded[spi_idx])
823 if (SYSPARAMS_Load( SPI_SETGRIDGRANULARITY_REGKEY,
824 SPI_SETGRIDGRANULARITY_VALNAME,
826 grid_granularity = atoi( buf );
828 spi_loaded[spi_idx] = TRUE;
830 *(INT *)pvParam = grid_granularity;
833 case SPI_SETGRIDGRANULARITY: /* 19 */
837 spi_idx = SPI_SETGRIDGRANULARITY_IDX;
838 sprintf(buf, "%u", uiParam);
840 if (SYSPARAMS_Save( SPI_SETGRIDGRANULARITY_REGKEY,
841 SPI_SETGRIDGRANULARITY_VALNAME,
844 grid_granularity = uiParam;
845 spi_loaded[spi_idx] = TRUE;
852 case SPI_SETDESKWALLPAPER: /* 20 */
853 SYSPARAMS_Save(SPI_SETDESKWALLPAPER_REGKEY, SPI_SETDESKWALLPAPER_VALNAME, pvParam, fWinIni);
854 ret = SetDeskWallPaper( (LPSTR)pvParam );
856 case SPI_SETDESKPATTERN: /* 21 */
857 /* FIXME: the ability to specify a pattern in pvParam
858 doesn't seem to be documented for Win32 */
859 if ((INT16)uiParam == -1)
862 GetProfileStringA( "Desktop", "Pattern",
863 "170 85 170 85 170 85 170 85",
864 buffer, sizeof(buffer) );
865 ret = DESKTOP_SetPattern( (LPSTR)buffer );
867 ret = DESKTOP_SetPattern( (LPSTR)pvParam );
870 case SPI_GETKEYBOARDDELAY: /* 22 */
871 spi_idx = SPI_SETKEYBOARDDELAY_IDX;
872 if (!spi_loaded[spi_idx])
876 if (SYSPARAMS_Load( SPI_SETKEYBOARDDELAY_REGKEY,
877 SPI_SETKEYBOARDDELAY_VALNAME,
881 if ( (i >= 0) && (i <= 3)) keyboard_delay = i;
884 spi_loaded[spi_idx] = TRUE;
886 *(INT *)pvParam = keyboard_delay;
889 case SPI_SETKEYBOARDDELAY: /* 23 */
893 spi_idx = SPI_SETKEYBOARDDELAY_IDX;
894 sprintf(buf, "%u", uiParam);
896 if (SYSPARAMS_Save( SPI_SETKEYBOARDDELAY_REGKEY,
897 SPI_SETKEYBOARDDELAY_VALNAME,
901 keyboard_delay = uiParam;
902 spi_loaded[spi_idx] = TRUE;
909 case SPI_ICONVERTICALSPACING: /* 24 */
910 spi_idx = SPI_ICONVERTICALSPACING_IDX;
913 if (!spi_loaded[spi_idx])
918 if (SYSPARAMS_Load( SPI_ICONVERTICALSPACING_REGKEY,
919 SPI_ICONVERTICALSPACING_VALNAME, buf ))
921 val = SYSPARAMS_Twips2Pixels( atoi(buf) );
922 SYSMETRICS_Set( SM_CYICONSPACING, val );
924 spi_loaded[spi_idx] = TRUE;
927 *(INT *)pvParam = GetSystemMetrics( SM_CYICONSPACING );
933 if (uiParam < 32) uiParam = 32;
935 sprintf(buf, "%u", uiParam);
936 if (SYSPARAMS_Save( SPI_ICONVERTICALSPACING_REGKEY,
937 SPI_ICONVERTICALSPACING_VALNAME,
940 SYSMETRICS_Set( SM_CYICONSPACING, uiParam );
941 spi_loaded[spi_idx] = TRUE;
949 case SPI_GETICONTITLEWRAP: /* 25 */
950 spi_idx = SPI_SETICONTITLEWRAP_IDX;
951 if (!spi_loaded[spi_idx])
955 if (SYSPARAMS_Load( SPI_SETICONTITLEWRAP_REGKEY1,
956 SPI_SETICONTITLEWRAP_VALNAME, buf ))
957 icon_title_wrap = atoi(buf);
958 spi_loaded[spi_idx] = TRUE;
961 *(BOOL *)pvParam = icon_title_wrap;
964 case SPI_SETICONTITLEWRAP: /* 26 */
968 spi_idx = SPI_SETICONTITLEWRAP_IDX;
969 sprintf(buf, "%u", uiParam);
970 if (SYSPARAMS_Save( SPI_SETICONTITLEWRAP_REGKEY1,
971 SPI_SETICONTITLEWRAP_VALNAME,
974 SYSPARAMS_Save( SPI_SETICONTITLEWRAP_REGKEY2,
975 SPI_SETICONTITLEWRAP_VALNAME,
977 icon_title_wrap = uiParam;
978 spi_loaded[spi_idx] = TRUE;
985 case SPI_GETMENUDROPALIGNMENT: /* 27 */
986 spi_idx = SPI_SETMENUDROPALIGNMENT_IDX;
988 if (!spi_loaded[spi_idx])
992 if (SYSPARAMS_Load( SPI_SETMENUDROPALIGNMENT_REGKEY1,
993 SPI_SETMENUDROPALIGNMENT_VALNAME, buf ))
995 SYSMETRICS_Set( SM_MENUDROPALIGNMENT, atoi( buf ) );
997 spi_loaded[spi_idx] = TRUE;
1001 *(BOOL *)pvParam = GetSystemMetrics( SM_MENUDROPALIGNMENT );
1004 case SPI_SETMENUDROPALIGNMENT: /* 28 */
1007 spi_idx = SPI_SETMENUDROPALIGNMENT_IDX;
1009 sprintf(buf, "%u", uiParam);
1010 if (SYSPARAMS_Save( SPI_SETMENUDROPALIGNMENT_REGKEY1,
1011 SPI_SETMENUDROPALIGNMENT_VALNAME,
1014 SYSPARAMS_Save( SPI_SETMENUDROPALIGNMENT_REGKEY2,
1015 SPI_SETMENUDROPALIGNMENT_VALNAME,
1017 SYSMETRICS_Set( SM_MENUDROPALIGNMENT, uiParam );
1018 spi_loaded[spi_idx] = TRUE;
1025 case SPI_SETDOUBLECLKWIDTH: /* 29 */
1028 spi_idx = SPI_SETDOUBLECLKWIDTH_IDX;
1030 sprintf(buf, "%u", uiParam);
1031 if (SYSPARAMS_Save( SPI_SETDOUBLECLKWIDTH_REGKEY1,
1032 SPI_SETDOUBLECLKWIDTH_VALNAME,
1035 SYSPARAMS_Save( SPI_SETDOUBLECLKWIDTH_REGKEY2,
1036 SPI_SETDOUBLECLKWIDTH_VALNAME,
1038 SYSMETRICS_Set( SM_CXDOUBLECLK, uiParam );
1039 spi_loaded[spi_idx] = TRUE;
1046 case SPI_SETDOUBLECLKHEIGHT: /* 30 */
1049 spi_idx = SPI_SETDOUBLECLKHEIGHT_IDX;
1051 sprintf(buf, "%u", uiParam);
1052 if (SYSPARAMS_Save( SPI_SETDOUBLECLKHEIGHT_REGKEY1,
1053 SPI_SETDOUBLECLKHEIGHT_VALNAME,
1056 SYSPARAMS_Save( SPI_SETDOUBLECLKHEIGHT_REGKEY2,
1057 SPI_SETDOUBLECLKHEIGHT_VALNAME,
1059 SYSMETRICS_Set( SM_CYDOUBLECLK, uiParam );
1060 spi_loaded[spi_idx] = TRUE;
1067 case SPI_GETICONTITLELOGFONT: /* 31 */
1069 LPLOGFONTA lpLogFont = (LPLOGFONTA)pvParam;
1073 * The 'default GDI fonts' seems to be returned.
1074 * If a returned font is not a correct font in your environment,
1075 * please try to fix objects/gdiobj.c at first.
1077 SYSPARAMS_GetGUIFont( &lfDefault );
1079 GetProfileStringA( "Desktop", "IconTitleFaceName",
1080 lfDefault.lfFaceName,
1081 lpLogFont->lfFaceName, LF_FACESIZE );
1082 lpLogFont->lfHeight = -GetProfileIntA( "Desktop", "IconTitleSize", 11 );
1083 lpLogFont->lfWidth = 0;
1084 lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
1085 lpLogFont->lfWeight = FW_NORMAL;
1086 lpLogFont->lfItalic = FALSE;
1087 lpLogFont->lfStrikeOut = FALSE;
1088 lpLogFont->lfUnderline = FALSE;
1089 lpLogFont->lfCharSet = lfDefault.lfCharSet; /* at least 'charset' should not be hard-coded */
1090 lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
1091 lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
1092 lpLogFont->lfPitchAndFamily = DEFAULT_PITCH;
1096 case SPI_SETDOUBLECLICKTIME: /* 32 */
1100 spi_idx = SPI_SETDOUBLECLICKTIME_IDX;
1101 sprintf(buf, "%u", uiParam);
1103 if (SYSPARAMS_Save( SPI_SETDOUBLECLICKTIME_REGKEY,
1104 SPI_SETDOUBLECLICKTIME_VALNAME,
1109 double_click_time = uiParam;
1110 spi_loaded[spi_idx] = TRUE;
1117 case SPI_SETMOUSEBUTTONSWAP: /* 33 */
1120 spi_idx = SPI_SETMOUSEBUTTONSWAP_IDX;
1122 sprintf(buf, "%u", uiParam);
1123 if (SYSPARAMS_Save( SPI_SETMOUSEBUTTONSWAP_REGKEY,
1124 SPI_SETMOUSEBUTTONSWAP_VALNAME,
1127 SYSMETRICS_Set( SM_SWAPBUTTON, uiParam );
1128 spi_loaded[spi_idx] = TRUE;
1135 WINE_SPI_FIXME(SPI_SETICONTITLELOGFONT); /* 34 */
1137 case SPI_GETFASTTASKSWITCH: /* 35 */
1138 *(BOOL *)pvParam = 1;
1141 case SPI_SETFASTTASKSWITCH: /* 36 */
1142 /* the action is disabled */
1146 case SPI_SETDRAGFULLWINDOWS: /* 37 WINVER >= 0x0400 */
1150 spi_idx = SPI_SETDRAGFULLWINDOWS_IDX;
1151 sprintf(buf, "%u", uiParam);
1152 if (SYSPARAMS_Save( SPI_SETDRAGFULLWINDOWS_REGKEY,
1153 SPI_SETDRAGFULLWINDOWS_VALNAME,
1156 drag_full_windows = uiParam;
1157 spi_loaded[spi_idx] = TRUE;
1164 case SPI_GETDRAGFULLWINDOWS: /* 38 WINVER >= 0x0400 */
1165 spi_idx = SPI_SETDRAGFULLWINDOWS_IDX;
1166 if (!spi_loaded[spi_idx])
1170 if (SYSPARAMS_Load( SPI_SETDRAGFULLWINDOWS_REGKEY,
1171 SPI_SETDRAGFULLWINDOWS_VALNAME, buf ))
1172 drag_full_windows = atoi(buf);
1173 spi_loaded[spi_idx] = TRUE;
1176 *(BOOL *)pvParam = drag_full_windows;
1179 case SPI_GETNONCLIENTMETRICS: /* 41 WINVER >= 0x400 */
1181 LPNONCLIENTMETRICSA lpnm = (LPNONCLIENTMETRICSA)pvParam;
1183 if (lpnm->cbSize == sizeof(NONCLIENTMETRICSA))
1185 /* clear the struct, so we have 'sane' members */
1187 (char *)pvParam + sizeof(lpnm->cbSize),
1189 lpnm->cbSize - sizeof(lpnm->cbSize)
1192 /* initialize geometry entries */
1193 lpnm->iBorderWidth = 1;
1194 lpnm->iScrollWidth = GetSystemMetrics(SM_CXVSCROLL);
1195 lpnm->iScrollHeight = GetSystemMetrics(SM_CYHSCROLL);
1197 /* size of the normal caption buttons */
1198 lpnm->iCaptionWidth = GetSystemMetrics(SM_CXSIZE);
1199 lpnm->iCaptionHeight = GetSystemMetrics(SM_CYSIZE);
1201 /* caption font metrics */
1202 SystemParametersInfoA( SPI_GETICONTITLELOGFONT, 0, (LPVOID)&(lpnm->lfCaptionFont), 0 );
1203 lpnm->lfCaptionFont.lfWeight = FW_BOLD;
1205 /* size of the small caption buttons */
1206 lpnm->iSmCaptionWidth = GetSystemMetrics(SM_CXSMSIZE);
1207 lpnm->iSmCaptionHeight = GetSystemMetrics(SM_CYSMSIZE);
1209 /* small caption font metrics */
1210 SystemParametersInfoA( SPI_GETICONTITLELOGFONT, 0, (LPVOID)&(lpnm->lfSmCaptionFont), 0 );
1212 /* menus, FIXME: names of wine.conf entries are bogus */
1214 /* size of the menu (MDI) buttons */
1215 lpnm->iMenuWidth = GetSystemMetrics(SM_CXMENUSIZE);
1216 lpnm->iMenuHeight = GetSystemMetrics(SM_CYMENUSIZE);
1218 /* menu font metrics */
1219 SystemParametersInfoA( SPI_GETICONTITLELOGFONT, 0, (LPVOID)&(lpnm->lfMenuFont), 0 );
1220 GetProfileStringA( "Desktop", "MenuFont",
1221 (TWEAK_WineLook > WIN31_LOOK) ? lpnm->lfCaptionFont.lfFaceName : "System",
1222 lpnm->lfMenuFont.lfFaceName, LF_FACESIZE );
1223 lpnm->lfMenuFont.lfHeight = -GetProfileIntA( "Desktop", "MenuFontSize", 11 );
1224 lpnm->lfMenuFont.lfWeight = (TWEAK_WineLook > WIN31_LOOK) ? FW_NORMAL : FW_BOLD;
1226 /* status bar font metrics */
1227 SystemParametersInfoA( SPI_GETICONTITLELOGFONT, 0,
1228 (LPVOID)&(lpnm->lfStatusFont), 0 );
1229 /* message font metrics */
1230 SystemParametersInfoA( SPI_GETICONTITLELOGFONT, 0,
1231 (LPVOID)&(lpnm->lfMessageFont), 0 );
1235 WARN("size mismatch !! (is %d; should be %d)\n", lpnm->cbSize, sizeof(NONCLIENTMETRICSA));
1236 /* FIXME: SetLastError? */
1241 WINE_SPI_FIXME(SPI_SETNONCLIENTMETRICS); /* 42 WINVER >= 0x400 */
1243 case SPI_GETMINIMIZEDMETRICS: /* 43 WINVER >= 0x400 */
1245 MINIMIZEDMETRICS * lpMm = pvParam;
1246 if (lpMm->cbSize == sizeof(*lpMm))
1248 /* these taken from Win2k SP3 */
1258 WINE_SPI_FIXME(SPI_SETMINIMIZEDMETRICS); /* 44 WINVER >= 0x400 */
1260 case SPI_GETICONMETRICS: /* 45 WINVER >= 0x400 */
1262 LPICONMETRICSA lpIcon = pvParam;
1263 if(lpIcon && lpIcon->cbSize == sizeof(*lpIcon))
1265 SystemParametersInfoA( SPI_ICONHORIZONTALSPACING, 0,
1266 &lpIcon->iHorzSpacing, FALSE );
1267 SystemParametersInfoA( SPI_ICONVERTICALSPACING, 0,
1268 &lpIcon->iVertSpacing, FALSE );
1269 SystemParametersInfoA( SPI_GETICONTITLEWRAP, 0,
1270 &lpIcon->iTitleWrap, FALSE );
1271 SystemParametersInfoA( SPI_GETICONTITLELOGFONT, 0,
1272 &lpIcon->lfFont, FALSE );
1280 WINE_SPI_FIXME(SPI_SETICONMETRICS); /* 46 WINVER >= 0x400 */
1282 case SPI_SETWORKAREA: /* 47 WINVER >= 0x400 */
1285 RECT *pr = (RECT *) pvParam;
1287 spi_idx = SPI_SETWORKAREA_IDX;
1288 sprintf(buf, "%ld %ld %ld %ld",
1290 pr->right, pr->bottom );
1292 if (SYSPARAMS_Save( SPI_SETWORKAREA_REGKEY,
1293 SPI_SETWORKAREA_VALNAME,
1296 CopyRect( &work_area, (RECT *)pvParam );
1297 spi_loaded[spi_idx] = TRUE;
1304 case SPI_GETWORKAREA: /* 48 WINVER >= 0x400 */
1305 spi_idx = SPI_SETWORKAREA_IDX;
1306 if (!spi_loaded[spi_idx])
1310 SetRect( &work_area, 0, 0,
1311 GetSystemMetrics( SM_CXSCREEN ),
1312 GetSystemMetrics( SM_CYSCREEN ) );
1314 if (SYSPARAMS_Load( SPI_SETWORKAREA_REGKEY,
1315 SPI_SETWORKAREA_VALNAME,
1318 sscanf( buf, "%ld %ld %ld %ld",
1319 &work_area.left, &work_area.top,
1320 &work_area.right, &work_area.bottom );
1322 spi_loaded[spi_idx] = TRUE;
1324 CopyRect( (RECT *)pvParam, &work_area );
1328 WINE_SPI_FIXME(SPI_SETPENWINDOWS); /* 49 WINVER >= 0x400 */
1330 case SPI_GETFILTERKEYS: /* 50 */
1332 LPFILTERKEYS lpFilterKeys = (LPFILTERKEYS)pvParam;
1333 WARN("SPI_GETFILTERKEYS not fully implemented\n");
1334 if (lpFilterKeys->cbSize == sizeof(FILTERKEYS))
1336 /* Indicate that no FilterKeys feature available */
1337 lpFilterKeys->dwFlags = 0;
1338 lpFilterKeys->iWaitMSec = 0;
1339 lpFilterKeys->iDelayMSec = 0;
1340 lpFilterKeys->iRepeatMSec = 0;
1341 lpFilterKeys->iBounceMSec = 0;
1349 WINE_SPI_FIXME(SPI_SETFILTERKEYS); /* 51 */
1351 case SPI_GETTOGGLEKEYS: /* 52 */
1353 LPTOGGLEKEYS lpToggleKeys = (LPTOGGLEKEYS)pvParam;
1354 WARN("SPI_GETTOGGLEKEYS not fully implemented\n");
1355 if (lpToggleKeys->cbSize == sizeof(TOGGLEKEYS))
1357 /* Indicate that no ToggleKeys feature available */
1358 lpToggleKeys->dwFlags = 0;
1366 WINE_SPI_FIXME(SPI_SETTOGGLEKEYS); /* 53 */
1368 case SPI_GETMOUSEKEYS: /* 54 */
1370 LPMOUSEKEYS lpMouseKeys = (LPMOUSEKEYS)pvParam;
1371 WARN("SPI_GETMOUSEKEYS not fully implemented\n");
1372 if (lpMouseKeys->cbSize == sizeof(MOUSEKEYS))
1374 /* Indicate that no MouseKeys feature available */
1375 lpMouseKeys->dwFlags = 0;
1376 lpMouseKeys->iMaxSpeed = 360;
1377 lpMouseKeys->iTimeToMaxSpeed = 1000;
1378 lpMouseKeys->iCtrlSpeed = 0;
1379 lpMouseKeys->dwReserved1 = 0;
1380 lpMouseKeys->dwReserved2 = 0;
1388 WINE_SPI_FIXME(SPI_SETMOUSEKEYS); /* 55 */
1390 case SPI_GETSHOWSOUNDS: /* 56 */
1391 spi_idx = SPI_SETSHOWSOUNDS_IDX;
1393 if (!spi_loaded[spi_idx])
1397 if (SYSPARAMS_Load( SPI_SETSHOWSOUNDS_REGKEY,
1398 SPI_SETSHOWSOUNDS_VALNAME, buf ))
1400 SYSMETRICS_Set( SM_SHOWSOUNDS, atoi( buf ) );
1402 spi_loaded[spi_idx] = TRUE;
1406 *(INT *)pvParam = GetSystemMetrics( SM_SHOWSOUNDS );
1409 case SPI_SETSHOWSOUNDS: /* 57 */
1412 spi_idx = SPI_SETSHOWSOUNDS_IDX;
1414 sprintf(buf, "%u", uiParam);
1415 if (SYSPARAMS_Save( SPI_SETSHOWSOUNDS_REGKEY,
1416 SPI_SETSHOWSOUNDS_VALNAME,
1419 SYSMETRICS_Set( SM_SHOWSOUNDS, uiParam );
1420 spi_loaded[spi_idx] = TRUE;
1427 case SPI_GETSTICKYKEYS: /* 58 */
1429 LPSTICKYKEYS lpStickyKeys = (LPSTICKYKEYS)pvParam;
1430 WARN("SPI_GETSTICKYKEYS not fully implemented\n");
1431 if (lpStickyKeys->cbSize == sizeof(STICKYKEYS))
1433 /* Indicate that no StickyKeys feature available */
1434 lpStickyKeys->dwFlags = 0;
1442 WINE_SPI_FIXME(SPI_SETSTICKYKEYS); /* 59 */
1444 case SPI_GETACCESSTIMEOUT: /* 60 */
1446 LPACCESSTIMEOUT lpAccessTimeout = (LPACCESSTIMEOUT)pvParam;
1447 WARN("SPI_GETACCESSTIMEOUT not fully implemented\n");
1448 if (lpAccessTimeout->cbSize == sizeof(ACCESSTIMEOUT))
1450 /* Indicate that no accessibility features timeout is available */
1451 lpAccessTimeout->dwFlags = 0;
1452 lpAccessTimeout->iTimeOutMSec = 0;
1460 WINE_SPI_FIXME(SPI_SETACCESSTIMEOUT); /* 61 */
1462 case SPI_GETSERIALKEYS: /* 62 WINVER >= 0x400 */
1464 LPSERIALKEYSA lpSerialKeysA = (LPSERIALKEYSA)pvParam;
1465 WARN("SPI_GETSERIALKEYS not fully implemented\n");
1466 if (lpSerialKeysA->cbSize == sizeof(SERIALKEYSA))
1468 /* Indicate that no SerialKeys feature available */
1469 lpSerialKeysA->dwFlags = 0;
1470 lpSerialKeysA->lpszActivePort = NULL;
1471 lpSerialKeysA->lpszPort = NULL;
1472 lpSerialKeysA->iBaudRate = 0;
1473 lpSerialKeysA->iPortState = 0;
1481 WINE_SPI_FIXME(SPI_SETSERIALKEYS); /* 63 WINVER >= 0x400 */
1483 case SPI_GETSOUNDSENTRY: /* 64 */
1485 LPSOUNDSENTRYA lpSoundSentryA = (LPSOUNDSENTRYA)pvParam;
1486 WARN("SPI_GETSOUNDSENTRY not fully implemented\n");
1487 if (lpSoundSentryA->cbSize == sizeof(SOUNDSENTRYA))
1489 /* Indicate that no SoundSentry feature available */
1490 lpSoundSentryA->dwFlags = 0;
1491 lpSoundSentryA->iFSTextEffect = 0;
1492 lpSoundSentryA->iFSTextEffectMSec = 0;
1493 lpSoundSentryA->iFSTextEffectColorBits = 0;
1494 lpSoundSentryA->iFSGrafEffect = 0;
1495 lpSoundSentryA->iFSGrafEffectMSec = 0;
1496 lpSoundSentryA->iFSGrafEffectColor = 0;
1497 lpSoundSentryA->iWindowsEffect = 0;
1498 lpSoundSentryA->iWindowsEffectMSec = 0;
1499 lpSoundSentryA->lpszWindowsEffectDLL = 0;
1500 lpSoundSentryA->iWindowsEffectOrdinal = 0;
1508 WINE_SPI_FIXME(SPI_SETSOUNDSENTRY); /* 65 */
1510 case SPI_GETHIGHCONTRAST: /* 66 WINVER >= 0x400 */
1512 LPHIGHCONTRASTA lpHighContrastA = (LPHIGHCONTRASTA)pvParam;
1513 WARN("SPI_GETHIGHCONTRAST not fully implemented\n");
1514 if (lpHighContrastA->cbSize == sizeof(HIGHCONTRASTA))
1516 /* Indicate that no high contrast feature available */
1517 lpHighContrastA->dwFlags = 0;
1518 lpHighContrastA->lpszDefaultScheme = NULL;
1526 WINE_SPI_FIXME(SPI_SETHIGHCONTRAST); /* 67 WINVER >= 0x400 */
1528 case SPI_GETKEYBOARDPREF: /* 68 WINVER >= 0x400 */
1529 spi_idx = SPI_SETKEYBOARDPREF_IDX;
1530 if (!spi_loaded[spi_idx])
1534 if (SYSPARAMS_Load( SPI_SETKEYBOARDPREF_REGKEY,
1535 SPI_SETKEYBOARDPREF_VALNAME, buf ))
1536 keyboard_pref = atoi(buf);
1537 spi_loaded[spi_idx] = TRUE;
1540 *(BOOL *)pvParam = keyboard_pref;
1543 case SPI_SETKEYBOARDPREF: /* 69 WINVER >= 0x400 */
1547 spi_idx = SPI_SETKEYBOARDPREF_IDX;
1548 sprintf(buf, "%u", uiParam);
1549 if (SYSPARAMS_Save( SPI_SETKEYBOARDPREF_REGKEY,
1550 SPI_SETKEYBOARDPREF_VALNAME,
1553 keyboard_pref = uiParam;
1554 spi_loaded[spi_idx] = TRUE;
1561 case SPI_GETSCREENREADER: /* 70 WINVER >= 0x400 */
1562 spi_idx = SPI_SETSCREENREADER_IDX;
1563 if (!spi_loaded[spi_idx])
1567 if (SYSPARAMS_Load( SPI_SETSCREENREADER_REGKEY,
1568 SPI_SETSCREENREADER_VALNAME, buf ))
1569 screen_reader = atoi(buf);
1570 spi_loaded[spi_idx] = TRUE;
1573 *(BOOL *)pvParam = screen_reader;
1576 case SPI_SETSCREENREADER: /* 71 WINVER >= 0x400 */
1580 spi_idx = SPI_SETSCREENREADER_IDX;
1581 sprintf(buf, "%u", uiParam);
1582 if (SYSPARAMS_Save( SPI_SETSCREENREADER_REGKEY,
1583 SPI_SETSCREENREADER_VALNAME,
1586 screen_reader = uiParam;
1587 spi_loaded[spi_idx] = TRUE;
1594 case SPI_GETANIMATION: /* 72 WINVER >= 0x400 */
1596 LPANIMATIONINFO lpAnimInfo = (LPANIMATIONINFO)pvParam;
1598 /* Tell it "disabled" */
1599 if (lpAnimInfo->cbSize == sizeof(ANIMATIONINFO))
1600 lpAnimInfo->iMinAnimate = 0; /* Minimise and restore animation is disabled (nonzero == enabled) */
1605 WINE_SPI_WARN(SPI_SETANIMATION); /* 73 WINVER >= 0x400 */
1607 WINE_SPI_FIXME(SPI_GETFONTSMOOTHING); /* 74 WINVER >= 0x400 */
1608 WINE_SPI_FIXME(SPI_SETFONTSMOOTHING); /* 75 WINVER >= 0x400 */
1610 WINE_SPI_FIXME(SPI_SETDRAGWIDTH); /* 76 WINVER >= 0x400 */
1611 WINE_SPI_FIXME(SPI_SETDRAGHEIGHT); /* 77 WINVER >= 0x400 */
1613 WINE_SPI_FIXME(SPI_SETHANDHELD); /* 78 WINVER >= 0x400 */
1615 WINE_SPI_FIXME(SPI_GETLOWPOWERTIMEOUT); /* 79 WINVER >= 0x400 */
1616 WINE_SPI_FIXME(SPI_GETPOWEROFFTIMEOUT); /* 80 WINVER >= 0x400 */
1617 WINE_SPI_FIXME(SPI_SETLOWPOWERTIMEOUT); /* 81 WINVER >= 0x400 */
1618 WINE_SPI_FIXME(SPI_SETPOWEROFFTIMEOUT); /* 82 WINVER >= 0x400 */
1619 WINE_SPI_FIXME(SPI_GETLOWPOWERACTIVE); /* 83 WINVER >= 0x400 */
1620 WINE_SPI_FIXME(SPI_GETPOWEROFFACTIVE); /* 84 WINVER >= 0x400 */
1621 WINE_SPI_FIXME(SPI_SETLOWPOWERACTIVE); /* 85 WINVER >= 0x400 */
1622 WINE_SPI_FIXME(SPI_SETPOWEROFFACTIVE); /* 86 WINVER >= 0x400 */
1624 WINE_SPI_FIXME(SPI_SETCURSORS); /* 87 WINVER >= 0x400 */
1625 WINE_SPI_FIXME(SPI_SETICONS); /* 88 WINVER >= 0x400 */
1627 case SPI_GETDEFAULTINPUTLANG: /* 89 WINVER >= 0x400 */
1628 ret = GetKeyboardLayout(0) ? TRUE : FALSE;
1631 WINE_SPI_FIXME(SPI_SETDEFAULTINPUTLANG); /* 90 WINVER >= 0x400 */
1633 WINE_SPI_FIXME(SPI_SETLANGTOGGLE); /* 91 WINVER >= 0x400 */
1635 case SPI_GETWINDOWSEXTENSION: /* 92 WINVER >= 0x400 */
1636 WARN("pretend no support for Win9x Plus! for now.\n");
1637 ret = FALSE; /* yes, this is the result value */
1640 WINE_SPI_FIXME(SPI_SETMOUSETRAILS); /* 93 WINVER >= 0x400 */
1641 WINE_SPI_FIXME(SPI_GETMOUSETRAILS); /* 94 WINVER >= 0x400 */
1643 case SPI_SETSCREENSAVERRUNNING: /* 97 WINVER >= 0x400 */
1645 /* SPI_SCREENSAVERRUNNING is an alias for SPI_SETSCREENSAVERRUNNING */
1648 spi_idx = SPI_SETSCREENSAVERRUNNING_IDX;
1649 sprintf(buf, "%u", uiParam);
1651 /* save only temporarily */
1652 if (SYSPARAMS_Save( SPI_SETSCREENSAVERRUNNING_REGKEY,
1653 SPI_SETSCREENSAVERRUNNING_VALNAME,
1656 screensaver_running = uiParam;
1657 spi_loaded[spi_idx] = TRUE;
1664 case SPI_GETMOUSEHOVERWIDTH: /* 98 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1665 *(UINT *)pvParam = 4;
1667 WINE_SPI_FIXME(SPI_SETMOUSEHOVERWIDTH); /* 99 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1669 case SPI_GETMOUSEHOVERHEIGHT: /* 100 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1670 *(UINT *)pvParam = 4;
1672 WINE_SPI_FIXME(SPI_SETMOUSEHOVERHEIGHT); /* 101 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1674 case SPI_GETMOUSEHOVERTIME: /* 102 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1675 *(UINT *)pvParam = 400; /* default for menu dropdowns */
1677 WINE_SPI_FIXME(SPI_SETMOUSEHOVERTIME); /* 103 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1679 case SPI_GETWHEELSCROLLLINES: /* 104 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1680 *(UINT *)pvParam = 3; /* default for num scroll lines */
1683 WINE_SPI_FIXME(SPI_SETWHEELSCROLLLINES); /* 105 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1685 case SPI_GETMENUSHOWDELAY: /* 106 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1686 *(UINT *)pvParam = 400; /* Tested against Windows NT 4.0 and Windows 2000 */
1689 WINE_SPI_FIXME(SPI_GETSHOWIMEUI); /* 110 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1690 WINE_SPI_FIXME(SPI_SETSHOWIMEUI); /* 111 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1692 case SPI_GETSCREENSAVERRUNNING: /* 114 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1693 spi_idx = SPI_SETSCREENSAVERRUNNING_IDX;
1694 if (!spi_loaded[spi_idx])
1698 if (SYSPARAMS_Load( SPI_SETSCREENSAVERRUNNING_REGKEY,
1699 SPI_SETSCREENSAVERRUNNING_VALNAME, buf ))
1700 screensaver_running = atoi( buf );
1701 spi_loaded[spi_idx] = TRUE;
1704 *(BOOL *)pvParam = screensaver_running;
1707 case SPI_GETDESKWALLPAPER: /* 115 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1711 if (uiParam > MAX_PATH)
1716 if (SYSPARAMS_Load(SPI_SETDESKWALLPAPER_REGKEY, SPI_SETDESKWALLPAPER_VALNAME, buf))
1718 strncpy((char*)pvParam, buf, uiParam);
1722 /* Return an empty string */
1723 memset((char*)pvParam, 0, uiParam);
1729 WINE_SPI_FIXME(SPI_GETACTIVEWINDOWTRACKING);/* 0x1000 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1730 WINE_SPI_FIXME(SPI_SETACTIVEWINDOWTRACKING);/* 0x1001 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1731 WINE_SPI_FIXME(SPI_GETMENUANIMATION); /* 0x1002 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1732 WINE_SPI_FIXME(SPI_SETMENUANIMATION); /* 0x1003 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1733 WINE_SPI_FIXME(SPI_GETCOMBOBOXANIMATION); /* 0x1004 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1734 WINE_SPI_FIXME(SPI_SETCOMBOBOXANIMATION); /* 0x1005 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1735 WINE_SPI_FIXME(SPI_GETLISTBOXSMOOTHSCROLLING);/* 0x1006 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1736 WINE_SPI_FIXME(SPI_SETLISTBOXSMOOTHSCROLLING);/* 0x1007 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1738 case SPI_GETGRADIENTCAPTIONS: /* 0x1008 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1739 FIXME("case SPI_GETGRADIENTCAPTIONS always return false\n");
1740 *(BOOL *)pvParam = FALSE;
1743 WINE_SPI_FIXME(SPI_SETGRADIENTCAPTIONS); /* 0x1009 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1744 WINE_SPI_FIXME(SPI_GETKEYBOARDCUES); /* 0x100A _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1745 WINE_SPI_FIXME(SPI_SETKEYBOARDCUES); /* 0x100B _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1746 WINE_SPI_FIXME(SPI_GETACTIVEWNDTRKZORDER); /* 0x100C _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1747 WINE_SPI_FIXME(SPI_SETACTIVEWNDTRKZORDER); /* 0x100D _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1748 WINE_SPI_FIXME(SPI_GETHOTTRACKING); /* 0x100E _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1749 WINE_SPI_FIXME(SPI_SETHOTTRACKING); /* 0x100F _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1750 WINE_SPI_FIXME(SPI_GETSELECTIONFADE); /* 0x1014 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1751 WINE_SPI_FIXME(SPI_SETSELECTIONFADE); /* 0x1015 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1752 WINE_SPI_FIXME(SPI_GETDROPSHADOW); /* 0x1024 _WIN32_WINNT >= 0x510 */
1753 WINE_SPI_FIXME(SPI_SETDROPSHADOW); /* 0x1025 _WIN32_WINNT >= 0x510 */
1754 WINE_SPI_FIXME(SPI_GETFOREGROUNDLOCKTIMEOUT);/* 0x2000 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1755 WINE_SPI_FIXME(SPI_SETFOREGROUNDLOCKTIMEOUT);/* 0x2001 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1756 WINE_SPI_FIXME(SPI_GETACTIVEWNDTRKTIMEOUT); /* 0x2002 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1757 WINE_SPI_FIXME(SPI_SETACTIVEWNDTRKTIMEOUT); /* 0x2003 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1758 WINE_SPI_FIXME(SPI_GETFOREGROUNDFLASHCOUNT);/* 0x2004 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1759 WINE_SPI_FIXME(SPI_SETFOREGROUNDFLASHCOUNT);/* 0x2005 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1762 FIXME( "Unknown action: %u\n", uiAction );
1763 SetLastError( ERROR_INVALID_SPI_VALUE );
1769 SYSPARAMS_NotifyChange( uiAction, fWinIni );
1772 #undef WINE_SPI_FIXME
1773 #undef WINE_SPI_WARN
1777 /***********************************************************************
1778 * SystemParametersInfo (USER.483)
1780 BOOL16 WINAPI SystemParametersInfo16( UINT16 uAction, UINT16 uParam,
1781 LPVOID lpvParam, UINT16 fuWinIni )
1785 TRACE("(%u, %u, %p, %u)\n", uAction, uParam, lpvParam, fuWinIni);
1789 case SPI_GETBEEP: /* 1 */
1790 case SPI_GETSCREENSAVEACTIVE: /* 16 */
1791 case SPI_GETICONTITLEWRAP: /* 25 */
1792 case SPI_GETMENUDROPALIGNMENT: /* 27 */
1793 case SPI_GETFASTTASKSWITCH: /* 35 */
1794 case SPI_GETDRAGFULLWINDOWS: /* 38 WINVER >= 0x0400 */
1797 ret = SystemParametersInfoA( uAction, uParam, lpvParam ? &tmp : NULL, fuWinIni );
1798 if (ret && lpvParam)
1799 *(BOOL16 *)lpvParam = tmp;
1803 case SPI_GETBORDER: /* 5 */
1804 case SPI_ICONHORIZONTALSPACING: /* 13 */
1805 case SPI_GETSCREENSAVETIMEOUT: /* 14 */
1806 case SPI_GETGRIDGRANULARITY: /* 18 */
1807 case SPI_GETKEYBOARDDELAY: /* 22 */
1808 case SPI_ICONVERTICALSPACING: /* 24 */
1811 ret = SystemParametersInfoA( uAction, uParam, lpvParam ? &tmp : NULL, fuWinIni );
1812 if (ret && lpvParam)
1813 *(INT16 *)lpvParam = tmp;
1817 case SPI_GETKEYBOARDSPEED: /* 10 */
1820 ret = SystemParametersInfoA( uAction, uParam, lpvParam ? &tmp : NULL, fuWinIni );
1821 if (ret && lpvParam)
1822 *(WORD *)lpvParam = tmp;
1826 case SPI_GETICONTITLELOGFONT: /* 31 */
1829 ret = SystemParametersInfoA( uAction, uParam, lpvParam ? &tmp : NULL, fuWinIni );
1830 if (ret && lpvParam)
1831 SYSPARAMS_LogFont32ATo16( &tmp, (LPLOGFONT16)lpvParam );
1835 case SPI_GETNONCLIENTMETRICS: /* 41 WINVER >= 0x400 */
1837 NONCLIENTMETRICSA tmp;
1838 LPNONCLIENTMETRICS16 lpnm16 = (LPNONCLIENTMETRICS16)lpvParam;
1839 if (lpnm16 && lpnm16->cbSize == sizeof(NONCLIENTMETRICS16))
1841 tmp.cbSize = sizeof(NONCLIENTMETRICSA);
1842 ret = SystemParametersInfoA( uAction, uParam, &tmp, fuWinIni );
1844 SYSPARAMS_NonClientMetrics32ATo16( &tmp, lpnm16 );
1846 else /* winfile 95 sets cbSize to 340 */
1847 ret = SystemParametersInfoA( uAction, uParam, lpvParam, fuWinIni );
1851 case SPI_GETWORKAREA: /* 48 WINVER >= 0x400 */
1854 ret = SystemParametersInfoA( uAction, uParam, lpvParam ? &tmp : NULL, fuWinIni );
1855 if (ret && lpvParam)
1856 CONV_RECT32TO16( &tmp, (RECT16 *)lpvParam );
1860 case SPI_GETMOUSEHOVERWIDTH: /* 98 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1861 case SPI_GETMOUSEHOVERHEIGHT: /* 100 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1862 case SPI_GETMOUSEHOVERTIME: /* 102 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1865 ret = SystemParametersInfoA( uAction, uParam, lpvParam ? &tmp : NULL, fuWinIni );
1866 if (ret && lpvParam)
1867 *(UINT16 *)lpvParam = tmp;
1872 ret = SystemParametersInfoA( uAction, uParam, lpvParam, fuWinIni );
1878 /***********************************************************************
1879 * SystemParametersInfoW (USER32.@)
1881 BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
1882 PVOID pvParam, UINT fuWinIni )
1886 TRACE("(%u, %u, %p, %u)\n", uiAction, uiParam, pvParam, fuWinIni);
1890 case SPI_SETDESKWALLPAPER: /* 20 */
1891 case SPI_SETDESKPATTERN: /* 21 */
1895 if (!WideCharToMultiByte( CP_ACP, 0, (LPWSTR)pvParam, -1,
1896 buffer, sizeof(buffer), NULL, NULL ))
1897 buffer[sizeof(buffer)-1] = 0;
1898 ret = SystemParametersInfoA( uiAction, uiParam, pvParam ? buffer : NULL, fuWinIni );
1902 case SPI_GETICONTITLELOGFONT: /* 31 */
1905 ret = SystemParametersInfoA( uiAction, uiParam, pvParam ? &tmp : NULL, fuWinIni );
1907 SYSPARAMS_LogFont32ATo32W( &tmp, (LPLOGFONTW)pvParam );
1911 case SPI_GETNONCLIENTMETRICS: /* 41 WINVER >= 0x400 */
1913 NONCLIENTMETRICSA tmp;
1914 LPNONCLIENTMETRICSW lpnmW = (LPNONCLIENTMETRICSW)pvParam;
1915 if (lpnmW && lpnmW->cbSize == sizeof(NONCLIENTMETRICSW))
1917 tmp.cbSize = sizeof(NONCLIENTMETRICSA);
1918 ret = SystemParametersInfoA( uiAction, uiParam, &tmp, fuWinIni );
1920 SYSPARAMS_NonClientMetrics32ATo32W( &tmp, lpnmW );
1927 case SPI_GETICONMETRICS: /* 45 WINVER >= 0x400 */
1930 LPICONMETRICSW lpimW = (LPICONMETRICSW)pvParam;
1931 if (lpimW && lpimW->cbSize == sizeof(ICONMETRICSW))
1933 tmp.cbSize = sizeof(ICONMETRICSA);
1934 ret = SystemParametersInfoA( uiAction, uiParam, &tmp, fuWinIni );
1937 lpimW->iHorzSpacing = tmp.iHorzSpacing;
1938 lpimW->iVertSpacing = tmp.iVertSpacing;
1939 lpimW->iTitleWrap = tmp.iTitleWrap;
1940 SYSPARAMS_LogFont32ATo32W( &tmp.lfFont, &lpimW->lfFont );
1948 case SPI_GETHIGHCONTRAST: /* 66 WINVER >= 0x400 */
1951 LPHIGHCONTRASTW lphcW = (LPHIGHCONTRASTW)pvParam;
1952 if (lphcW && lphcW->cbSize == sizeof(HIGHCONTRASTW))
1954 tmp.cbSize = sizeof(HIGHCONTRASTA);
1955 ret = SystemParametersInfoA( uiAction, uiParam, &tmp, fuWinIni );
1958 lphcW->dwFlags = tmp.dwFlags;
1959 lphcW->lpszDefaultScheme = NULL; /* FIXME? */
1968 ret = SystemParametersInfoA( uiAction, uiParam, pvParam, fuWinIni );
1975 /**********************************************************************
1976 * SetDoubleClickTime (USER32.@)
1978 BOOL WINAPI SetDoubleClickTime( UINT interval )
1980 return SystemParametersInfoA(SPI_SETDOUBLECLICKTIME, interval, 0, 0);
1984 /**********************************************************************
1985 * GetDoubleClickTime (USER32.@)
1987 UINT WINAPI GetDoubleClickTime(void)
1991 if (!spi_loaded[SPI_SETDOUBLECLICKTIME_IDX])
1993 if (SYSPARAMS_Load( SPI_SETDOUBLECLICKTIME_REGKEY,
1994 SPI_SETDOUBLECLICKTIME_VALNAME,
1997 double_click_time = atoi( buf );
1998 if (!double_click_time) double_click_time = 500;
2000 spi_loaded[SPI_SETDOUBLECLICKTIME_IDX] = TRUE;
2002 return double_click_time;