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
, DWORD count
)
381 if ((RegOpenKeyA( get_volatile_regkey(), lpRegKey
, &hKey
) == ERROR_SUCCESS
) ||
382 (RegOpenKeyA( HKEY_CURRENT_USER
, lpRegKey
, &hKey
) == ERROR_SUCCESS
))
384 ret
= !RegQueryValueExA( hKey
, lpValName
, NULL
, &type
, lpBuf
, &count
);
390 /***********************************************************************
391 * Saves system parameter to user profile.
393 BOOL
SYSPARAMS_Save( LPSTR lpRegKey
, LPSTR lpValName
, LPSTR lpValue
,
401 if (fWinIni
& SPIF_UPDATEINIFILE
)
403 hBaseKey
= HKEY_CURRENT_USER
;
408 hBaseKey
= get_volatile_regkey();
409 dwOptions
= REG_OPTION_VOLATILE
;
412 if (RegCreateKeyExA( hBaseKey
, lpRegKey
,
413 0, 0, dwOptions
, KEY_ALL_ACCESS
,
414 0, &hKey
, 0 ) == ERROR_SUCCESS
)
416 if (RegSetValueExA( hKey
, lpValName
, 0, REG_SZ
,
417 lpValue
, strlen(lpValue
) + 1 ) == ERROR_SUCCESS
)
420 if (hBaseKey
== HKEY_CURRENT_USER
)
421 RegDeleteKeyA( get_volatile_regkey(), lpRegKey
);
429 /***********************************************************************
430 * SYSPARAMS_GetDoubleClickSize
432 * There is no SPI_GETDOUBLECLK* so we export this function instead.
434 void SYSPARAMS_GetDoubleClickSize( INT
*width
, INT
*height
)
438 if (!spi_loaded
[SPI_SETDOUBLECLKWIDTH_IDX
])
442 if (SYSPARAMS_Load( SPI_SETDOUBLECLKWIDTH_REGKEY1
,
443 SPI_SETDOUBLECLKWIDTH_VALNAME
, buf
, sizeof(buf
) ))
445 SYSMETRICS_Set( SM_CXDOUBLECLK
, atoi( buf
) );
447 spi_loaded
[SPI_SETDOUBLECLKWIDTH_IDX
] = TRUE
;
449 if (!spi_loaded
[SPI_SETDOUBLECLKHEIGHT_IDX
])
451 if (SYSPARAMS_Load( SPI_SETDOUBLECLKHEIGHT_REGKEY1
,
452 SPI_SETDOUBLECLKHEIGHT_VALNAME
, buf
, sizeof(buf
) ))
454 SYSMETRICS_Set( SM_CYDOUBLECLK
, atoi( buf
) );
456 spi_loaded
[SPI_SETDOUBLECLKHEIGHT_IDX
] = TRUE
;
458 *width
= GetSystemMetrics( SM_CXDOUBLECLK
);
459 *height
= GetSystemMetrics( SM_CYDOUBLECLK
);
463 /***********************************************************************
464 * SYSPARAMS_GetMouseButtonSwap
466 * There is no SPI_GETMOUSEBUTTONSWAP so we export this function instead.
468 INT
SYSPARAMS_GetMouseButtonSwap( void )
470 int spi_idx
= SPI_SETMOUSEBUTTONSWAP_IDX
;
472 if (!spi_loaded
[spi_idx
])
476 if (SYSPARAMS_Load( SPI_SETMOUSEBUTTONSWAP_REGKEY
,
477 SPI_SETMOUSEBUTTONSWAP_VALNAME
, buf
, sizeof(buf
) ))
479 SYSMETRICS_Set( SM_SWAPBUTTON
, atoi( buf
) );
481 spi_loaded
[spi_idx
] = TRUE
;
484 return GetSystemMetrics( SM_SWAPBUTTON
);
487 /***********************************************************************
489 * SYSPARAMS_GetGUIFont
491 * fills LOGFONT with 'default GUI font'.
494 static void SYSPARAMS_GetGUIFont( LOGFONTA
* plf
)
498 memset( plf
, 0, sizeof(LOGFONTA
) );
499 hf
= (HFONT
)GetStockObject( DEFAULT_GUI_FONT
);
500 if ( GetObjectA( hf
, sizeof(LOGFONTA
), plf
) != sizeof(LOGFONTA
) )
503 * GetObjectA() would be succeeded always
504 * since this is a stock object
506 ERR("GetObjectA() failed\n");
510 /* copied from GetSystemMetrics()'s RegistryTwips2Pixels() */
511 inline static int SYSPARAMS_Twips2Pixels(int x
)
518 /***********************************************************************
519 * SystemParametersInfoA (USER32.@)
521 * Each system parameter has flag which shows whether the parameter
522 * is loaded or not. Parameters, stored directly in SysParametersInfo are
523 * loaded from registry only when they are requested and the flag is
524 * "false", after the loading the flag is set to "true". On interprocess
525 * notification of the parameter change the corresponding parameter flag is
526 * set to "false". The parameter value will be reloaded when it is requested
528 * Parameters, backed by or depend on GetSystemMetrics are processed
529 * differently. These parameters are always loaded. They are reloaded right
530 * away on interprocess change notification. We can't do lazy loading because
531 * we don't want to complicate GetSystemMetrics.
532 * Parameters, backed by X settings are read from corresponding setting.
533 * On the parameter change request the setting is changed. Interprocess change
534 * notifications are ignored.
535 * When parameter value is updated the changed value is stored in permanent
536 * registry branch if saving is requested. Otherwise it is stored
537 * in temporary branch
539 * Some SPI values can also be stored as Twips values in the registry,
540 * don't forget the conversion!
542 BOOL WINAPI
SystemParametersInfoA( UINT uiAction
, UINT uiParam
,
543 PVOID pvParam
, UINT fWinIni
)
545 #define WINE_SPI_FIXME(x) \
547 FIXME( "Unimplemented action: %u (%s)\n", x, #x ); \
548 SetLastError( ERROR_INVALID_SPI_VALUE ); \
551 #define WINE_SPI_WARN(x) \
553 WARN( "Ignored action: %u (%s)\n", x, #x ); \
557 unsigned spi_idx
= 0;
559 TRACE("(%u, %u, %p, %u)\n", uiAction
, uiParam
, pvParam
, fWinIni
);
563 case SPI_GETBEEP
: /* 1 */
564 spi_idx
= SPI_SETBEEP_IDX
;
565 if (!spi_loaded
[spi_idx
])
569 if (SYSPARAMS_Load( SPI_SETBEEP_REGKEY
, SPI_SETBEEP_VALNAME
, buf
, sizeof(buf
) ))
570 beep_active
= !strcasecmp( "Yes", buf
);
571 spi_loaded
[spi_idx
] = TRUE
;
574 *(BOOL
*)pvParam
= beep_active
;
577 case SPI_SETBEEP
: /* 2 */
578 spi_idx
= SPI_SETBEEP_IDX
;
579 if (SYSPARAMS_Save( SPI_SETBEEP_REGKEY
, SPI_SETBEEP_VALNAME
,
580 (uiParam
? "Yes" : "No"), fWinIni
))
582 beep_active
= uiParam
;
583 spi_loaded
[spi_idx
] = TRUE
;
589 case SPI_GETMOUSE
: /* 3 */
590 spi_idx
= SPI_SETMOUSE_IDX
;
591 if (!spi_loaded
[spi_idx
])
595 if (SYSPARAMS_Load( SPI_SETMOUSE_REGKEY
, SPI_SETMOUSE_VALNAME1
,
597 mouse_threshold1
= atoi( buf
);
598 if (SYSPARAMS_Load( SPI_SETMOUSE_REGKEY
, SPI_SETMOUSE_VALNAME2
,
600 mouse_threshold2
= atoi( buf
);
601 if (SYSPARAMS_Load( SPI_SETMOUSE_REGKEY
, SPI_SETMOUSE_VALNAME3
,
603 mouse_speed
= atoi( buf
);
604 spi_loaded
[spi_idx
] = TRUE
;
606 ((INT
*)pvParam
)[0] = mouse_threshold1
;
607 ((INT
*)pvParam
)[1] = mouse_threshold2
;
608 ((INT
*)pvParam
)[2] = mouse_speed
;
611 case SPI_SETMOUSE
: /* 4 */
615 spi_idx
= SPI_SETMOUSE_IDX
;
616 sprintf(buf
, "%d", ((INT
*)pvParam
)[0]);
618 if (SYSPARAMS_Save( SPI_SETMOUSE_REGKEY
, SPI_SETMOUSE_VALNAME1
,
621 mouse_threshold1
= ((INT
*)pvParam
)[0];
622 spi_loaded
[spi_idx
] = TRUE
;
624 sprintf(buf
, "%d", ((INT
*)pvParam
)[1]);
625 SYSPARAMS_Save( SPI_SETMOUSE_REGKEY
, SPI_SETMOUSE_VALNAME2
,
627 mouse_threshold2
= ((INT
*)pvParam
)[1];
629 sprintf(buf
, "%d", ((INT
*)pvParam
)[2]);
630 SYSPARAMS_Save( SPI_SETMOUSE_REGKEY
, SPI_SETMOUSE_VALNAME3
,
632 mouse_speed
= ((INT
*)pvParam
)[2];
639 case SPI_GETBORDER
: /* 5 */
640 spi_idx
= SPI_SETBORDER_IDX
;
641 if (!spi_loaded
[spi_idx
])
645 if (SYSPARAMS_Load( SPI_SETBORDER_REGKEY
, SPI_SETBORDER_VALNAME
, buf
, sizeof(buf
) ))
646 border
= SYSPARAMS_Twips2Pixels( atoi(buf
) );
648 spi_loaded
[spi_idx
] = TRUE
;
649 if (TWEAK_WineLook
> WIN31_LOOK
)
651 SYSMETRICS_Set( SM_CXFRAME
, border
+ GetSystemMetrics( SM_CXDLGFRAME
) );
652 SYSMETRICS_Set( SM_CYFRAME
, border
+ GetSystemMetrics( SM_CXDLGFRAME
) );
655 *(INT
*)pvParam
= border
;
658 case SPI_SETBORDER
: /* 6 */
662 spi_idx
= SPI_SETBORDER_IDX
;
663 sprintf(buf
, "%u", uiParam
);
665 if (SYSPARAMS_Save( SPI_SETBORDER_REGKEY
, SPI_SETBORDER_VALNAME
,
671 spi_loaded
[spi_idx
] = TRUE
;
672 if (TWEAK_WineLook
> WIN31_LOOK
)
674 SYSMETRICS_Set( SM_CXFRAME
, uiParam
+ GetSystemMetrics( SM_CXDLGFRAME
) );
675 SYSMETRICS_Set( SM_CYFRAME
, uiParam
+ GetSystemMetrics( SM_CXDLGFRAME
) );
684 case SPI_GETKEYBOARDSPEED
: /* 10 */
685 spi_idx
= SPI_SETKEYBOARDSPEED_IDX
;
686 if (!spi_loaded
[spi_idx
])
690 if (SYSPARAMS_Load( SPI_SETKEYBOARDSPEED_REGKEY
,
691 SPI_SETKEYBOARDSPEED_VALNAME
,
693 keyboard_speed
= atoi( buf
);
694 spi_loaded
[spi_idx
] = TRUE
;
696 *(INT
*)pvParam
= keyboard_speed
;
699 case SPI_SETKEYBOARDSPEED
: /* 11 */
703 spi_idx
= SPI_SETKEYBOARDSPEED_IDX
;
706 sprintf(buf
, "%u", uiParam
);
708 if (SYSPARAMS_Save( SPI_SETKEYBOARDSPEED_REGKEY
,
709 SPI_SETKEYBOARDSPEED_VALNAME
,
712 keyboard_speed
= uiParam
;
713 spi_loaded
[spi_idx
] = TRUE
;
720 /* not implemented in Windows */
721 WINE_SPI_WARN(SPI_LANGDRIVER
); /* 12 */
723 case SPI_ICONHORIZONTALSPACING
: /* 13 */
724 spi_idx
= SPI_ICONHORIZONTALSPACING_IDX
;
727 if (!spi_loaded
[spi_idx
])
732 if (SYSPARAMS_Load( SPI_ICONHORIZONTALSPACING_REGKEY
,
733 SPI_ICONHORIZONTALSPACING_VALNAME
, buf
, sizeof(buf
) ))
735 val
= SYSPARAMS_Twips2Pixels( atoi(buf
) );
736 SYSMETRICS_Set( SM_CXICONSPACING
, val
);
738 spi_loaded
[spi_idx
] = TRUE
;
741 *(INT
*)pvParam
= GetSystemMetrics( SM_CXICONSPACING
);
747 if (uiParam
< 32) uiParam
= 32;
749 sprintf(buf
, "%u", uiParam
);
750 if (SYSPARAMS_Save( SPI_ICONHORIZONTALSPACING_REGKEY
,
751 SPI_ICONHORIZONTALSPACING_VALNAME
,
754 SYSMETRICS_Set( SM_CXICONSPACING
, uiParam
);
755 spi_loaded
[spi_idx
] = TRUE
;
762 case SPI_GETSCREENSAVETIMEOUT
: /* 14 */
763 spi_idx
= SPI_SETSCREENSAVETIMEOUT_IDX
;
764 if (!spi_loaded
[spi_idx
])
768 if (SYSPARAMS_Load( SPI_SETSCREENSAVETIMEOUT_REGKEY
,
769 SPI_SETSCREENSAVETIMEOUT_VALNAME
,
771 screensave_timeout
= atoi( buf
);
773 spi_loaded
[spi_idx
] = TRUE
;
775 *(INT
*)pvParam
= screensave_timeout
;
778 case SPI_SETSCREENSAVETIMEOUT
: /* 15 */
782 spi_idx
= SPI_SETSCREENSAVETIMEOUT_IDX
;
783 sprintf(buf
, "%u", uiParam
);
785 if (SYSPARAMS_Save( SPI_SETSCREENSAVETIMEOUT_REGKEY
,
786 SPI_SETSCREENSAVETIMEOUT_VALNAME
,
789 screensave_timeout
= uiParam
;
790 spi_loaded
[spi_idx
] = TRUE
;
797 case SPI_GETSCREENSAVEACTIVE
: /* 16 */
798 *(BOOL
*)pvParam
= USER_Driver
.pGetScreenSaveActive();
801 case SPI_SETSCREENSAVEACTIVE
: /* 17 */
805 sprintf(buf
, "%u", uiParam
);
806 USER_Driver
.pSetScreenSaveActive( uiParam
);
807 /* saved value does not affect Wine */
808 SYSPARAMS_Save( SPI_SETSCREENSAVEACTIVE_REGKEY
,
809 SPI_SETSCREENSAVEACTIVE_VALNAME
,
814 case SPI_GETGRIDGRANULARITY
: /* 18 */
815 spi_idx
= SPI_SETGRIDGRANULARITY_IDX
;
816 if (!spi_loaded
[spi_idx
])
820 if (SYSPARAMS_Load( SPI_SETGRIDGRANULARITY_REGKEY
,
821 SPI_SETGRIDGRANULARITY_VALNAME
,
823 grid_granularity
= atoi( buf
);
825 spi_loaded
[spi_idx
] = TRUE
;
827 *(INT
*)pvParam
= grid_granularity
;
830 case SPI_SETGRIDGRANULARITY
: /* 19 */
834 spi_idx
= SPI_SETGRIDGRANULARITY_IDX
;
835 sprintf(buf
, "%u", uiParam
);
837 if (SYSPARAMS_Save( SPI_SETGRIDGRANULARITY_REGKEY
,
838 SPI_SETGRIDGRANULARITY_VALNAME
,
841 grid_granularity
= uiParam
;
842 spi_loaded
[spi_idx
] = TRUE
;
849 case SPI_SETDESKWALLPAPER
: /* 20 */
850 SYSPARAMS_Save(SPI_SETDESKWALLPAPER_REGKEY
, SPI_SETDESKWALLPAPER_VALNAME
, pvParam
, fWinIni
);
851 ret
= SetDeskWallPaper( (LPSTR
)pvParam
);
853 case SPI_SETDESKPATTERN
: /* 21 */
854 /* FIXME: the ability to specify a pattern in pvParam
855 doesn't seem to be documented for Win32 */
856 if ((INT16
)uiParam
== -1)
859 GetProfileStringA( "Desktop", "Pattern",
860 "170 85 170 85 170 85 170 85",
861 buffer
, sizeof(buffer
) );
862 ret
= DESKTOP_SetPattern( (LPSTR
)buffer
);
864 ret
= DESKTOP_SetPattern( (LPSTR
)pvParam
);
867 case SPI_GETKEYBOARDDELAY
: /* 22 */
868 spi_idx
= SPI_SETKEYBOARDDELAY_IDX
;
869 if (!spi_loaded
[spi_idx
])
873 if (SYSPARAMS_Load( SPI_SETKEYBOARDDELAY_REGKEY
,
874 SPI_SETKEYBOARDDELAY_VALNAME
,
878 if ( (i
>= 0) && (i
<= 3)) keyboard_delay
= i
;
881 spi_loaded
[spi_idx
] = TRUE
;
883 *(INT
*)pvParam
= keyboard_delay
;
886 case SPI_SETKEYBOARDDELAY
: /* 23 */
890 spi_idx
= SPI_SETKEYBOARDDELAY_IDX
;
891 sprintf(buf
, "%u", uiParam
);
893 if (SYSPARAMS_Save( SPI_SETKEYBOARDDELAY_REGKEY
,
894 SPI_SETKEYBOARDDELAY_VALNAME
,
898 keyboard_delay
= uiParam
;
899 spi_loaded
[spi_idx
] = TRUE
;
906 case SPI_ICONVERTICALSPACING
: /* 24 */
907 spi_idx
= SPI_ICONVERTICALSPACING_IDX
;
910 if (!spi_loaded
[spi_idx
])
915 if (SYSPARAMS_Load( SPI_ICONVERTICALSPACING_REGKEY
,
916 SPI_ICONVERTICALSPACING_VALNAME
, buf
, sizeof(buf
) ))
918 val
= SYSPARAMS_Twips2Pixels( atoi(buf
) );
919 SYSMETRICS_Set( SM_CYICONSPACING
, val
);
921 spi_loaded
[spi_idx
] = TRUE
;
924 *(INT
*)pvParam
= GetSystemMetrics( SM_CYICONSPACING
);
930 if (uiParam
< 32) uiParam
= 32;
932 sprintf(buf
, "%u", uiParam
);
933 if (SYSPARAMS_Save( SPI_ICONVERTICALSPACING_REGKEY
,
934 SPI_ICONVERTICALSPACING_VALNAME
,
937 SYSMETRICS_Set( SM_CYICONSPACING
, uiParam
);
938 spi_loaded
[spi_idx
] = TRUE
;
946 case SPI_GETICONTITLEWRAP
: /* 25 */
947 spi_idx
= SPI_SETICONTITLEWRAP_IDX
;
948 if (!spi_loaded
[spi_idx
])
952 if (SYSPARAMS_Load( SPI_SETICONTITLEWRAP_REGKEY1
,
953 SPI_SETICONTITLEWRAP_VALNAME
, buf
, sizeof(buf
) ))
954 icon_title_wrap
= atoi(buf
);
955 spi_loaded
[spi_idx
] = TRUE
;
958 *(BOOL
*)pvParam
= icon_title_wrap
;
961 case SPI_SETICONTITLEWRAP
: /* 26 */
965 spi_idx
= SPI_SETICONTITLEWRAP_IDX
;
966 sprintf(buf
, "%u", uiParam
);
967 if (SYSPARAMS_Save( SPI_SETICONTITLEWRAP_REGKEY1
,
968 SPI_SETICONTITLEWRAP_VALNAME
,
971 SYSPARAMS_Save( SPI_SETICONTITLEWRAP_REGKEY2
,
972 SPI_SETICONTITLEWRAP_VALNAME
,
974 icon_title_wrap
= uiParam
;
975 spi_loaded
[spi_idx
] = TRUE
;
982 case SPI_GETMENUDROPALIGNMENT
: /* 27 */
983 spi_idx
= SPI_SETMENUDROPALIGNMENT_IDX
;
985 if (!spi_loaded
[spi_idx
])
989 if (SYSPARAMS_Load( SPI_SETMENUDROPALIGNMENT_REGKEY1
,
990 SPI_SETMENUDROPALIGNMENT_VALNAME
, buf
, sizeof(buf
) ))
992 SYSMETRICS_Set( SM_MENUDROPALIGNMENT
, atoi( buf
) );
994 spi_loaded
[spi_idx
] = TRUE
;
998 *(BOOL
*)pvParam
= GetSystemMetrics( SM_MENUDROPALIGNMENT
);
1001 case SPI_SETMENUDROPALIGNMENT
: /* 28 */
1004 spi_idx
= SPI_SETMENUDROPALIGNMENT_IDX
;
1006 sprintf(buf
, "%u", uiParam
);
1007 if (SYSPARAMS_Save( SPI_SETMENUDROPALIGNMENT_REGKEY1
,
1008 SPI_SETMENUDROPALIGNMENT_VALNAME
,
1011 SYSPARAMS_Save( SPI_SETMENUDROPALIGNMENT_REGKEY2
,
1012 SPI_SETMENUDROPALIGNMENT_VALNAME
,
1014 SYSMETRICS_Set( SM_MENUDROPALIGNMENT
, uiParam
);
1015 spi_loaded
[spi_idx
] = TRUE
;
1022 case SPI_SETDOUBLECLKWIDTH
: /* 29 */
1025 spi_idx
= SPI_SETDOUBLECLKWIDTH_IDX
;
1027 sprintf(buf
, "%u", uiParam
);
1028 if (SYSPARAMS_Save( SPI_SETDOUBLECLKWIDTH_REGKEY1
,
1029 SPI_SETDOUBLECLKWIDTH_VALNAME
,
1032 SYSPARAMS_Save( SPI_SETDOUBLECLKWIDTH_REGKEY2
,
1033 SPI_SETDOUBLECLKWIDTH_VALNAME
,
1035 SYSMETRICS_Set( SM_CXDOUBLECLK
, uiParam
);
1036 spi_loaded
[spi_idx
] = TRUE
;
1043 case SPI_SETDOUBLECLKHEIGHT
: /* 30 */
1046 spi_idx
= SPI_SETDOUBLECLKHEIGHT_IDX
;
1048 sprintf(buf
, "%u", uiParam
);
1049 if (SYSPARAMS_Save( SPI_SETDOUBLECLKHEIGHT_REGKEY1
,
1050 SPI_SETDOUBLECLKHEIGHT_VALNAME
,
1053 SYSPARAMS_Save( SPI_SETDOUBLECLKHEIGHT_REGKEY2
,
1054 SPI_SETDOUBLECLKHEIGHT_VALNAME
,
1056 SYSMETRICS_Set( SM_CYDOUBLECLK
, uiParam
);
1057 spi_loaded
[spi_idx
] = TRUE
;
1064 case SPI_GETICONTITLELOGFONT
: /* 31 */
1066 LPLOGFONTA lpLogFont
= (LPLOGFONTA
)pvParam
;
1070 * The 'default GDI fonts' seems to be returned.
1071 * If a returned font is not a correct font in your environment,
1072 * please try to fix objects/gdiobj.c at first.
1074 SYSPARAMS_GetGUIFont( &lfDefault
);
1076 GetProfileStringA( "Desktop", "IconTitleFaceName",
1077 lfDefault
.lfFaceName
,
1078 lpLogFont
->lfFaceName
, LF_FACESIZE
);
1079 lpLogFont
->lfHeight
= -GetProfileIntA( "Desktop", "IconTitleSize", 11 );
1080 lpLogFont
->lfWidth
= 0;
1081 lpLogFont
->lfEscapement
= lpLogFont
->lfOrientation
= 0;
1082 lpLogFont
->lfWeight
= FW_NORMAL
;
1083 lpLogFont
->lfItalic
= FALSE
;
1084 lpLogFont
->lfStrikeOut
= FALSE
;
1085 lpLogFont
->lfUnderline
= FALSE
;
1086 lpLogFont
->lfCharSet
= lfDefault
.lfCharSet
; /* at least 'charset' should not be hard-coded */
1087 lpLogFont
->lfOutPrecision
= OUT_DEFAULT_PRECIS
;
1088 lpLogFont
->lfClipPrecision
= CLIP_DEFAULT_PRECIS
;
1089 lpLogFont
->lfPitchAndFamily
= DEFAULT_PITCH
;
1090 lpLogFont
->lfQuality
= DEFAULT_QUALITY
;
1094 case SPI_SETDOUBLECLICKTIME
: /* 32 */
1098 spi_idx
= SPI_SETDOUBLECLICKTIME_IDX
;
1099 sprintf(buf
, "%u", uiParam
);
1101 if (SYSPARAMS_Save( SPI_SETDOUBLECLICKTIME_REGKEY
,
1102 SPI_SETDOUBLECLICKTIME_VALNAME
,
1107 double_click_time
= uiParam
;
1108 spi_loaded
[spi_idx
] = TRUE
;
1115 case SPI_SETMOUSEBUTTONSWAP
: /* 33 */
1118 spi_idx
= SPI_SETMOUSEBUTTONSWAP_IDX
;
1120 sprintf(buf
, "%u", uiParam
);
1121 if (SYSPARAMS_Save( SPI_SETMOUSEBUTTONSWAP_REGKEY
,
1122 SPI_SETMOUSEBUTTONSWAP_VALNAME
,
1125 SYSMETRICS_Set( SM_SWAPBUTTON
, uiParam
);
1126 spi_loaded
[spi_idx
] = TRUE
;
1133 WINE_SPI_FIXME(SPI_SETICONTITLELOGFONT
); /* 34 */
1135 case SPI_GETFASTTASKSWITCH
: /* 35 */
1136 *(BOOL
*)pvParam
= 1;
1139 case SPI_SETFASTTASKSWITCH
: /* 36 */
1140 /* the action is disabled */
1144 case SPI_SETDRAGFULLWINDOWS
: /* 37 WINVER >= 0x0400 */
1148 spi_idx
= SPI_SETDRAGFULLWINDOWS_IDX
;
1149 sprintf(buf
, "%u", uiParam
);
1150 if (SYSPARAMS_Save( SPI_SETDRAGFULLWINDOWS_REGKEY
,
1151 SPI_SETDRAGFULLWINDOWS_VALNAME
,
1154 drag_full_windows
= uiParam
;
1155 spi_loaded
[spi_idx
] = TRUE
;
1162 case SPI_GETDRAGFULLWINDOWS
: /* 38 WINVER >= 0x0400 */
1163 spi_idx
= SPI_SETDRAGFULLWINDOWS_IDX
;
1164 if (!spi_loaded
[spi_idx
])
1168 if (SYSPARAMS_Load( SPI_SETDRAGFULLWINDOWS_REGKEY
,
1169 SPI_SETDRAGFULLWINDOWS_VALNAME
, buf
, sizeof(buf
) ))
1170 drag_full_windows
= atoi(buf
);
1171 spi_loaded
[spi_idx
] = TRUE
;
1174 *(BOOL
*)pvParam
= drag_full_windows
;
1177 case SPI_GETNONCLIENTMETRICS
: /* 41 WINVER >= 0x400 */
1179 LPNONCLIENTMETRICSA lpnm
= (LPNONCLIENTMETRICSA
)pvParam
;
1181 if (lpnm
->cbSize
== sizeof(NONCLIENTMETRICSA
))
1183 /* clear the struct, so we have 'sane' members */
1185 (char *)pvParam
+ sizeof(lpnm
->cbSize
),
1187 lpnm
->cbSize
- sizeof(lpnm
->cbSize
)
1190 /* initialize geometry entries */
1191 lpnm
->iBorderWidth
= 1;
1192 lpnm
->iScrollWidth
= GetSystemMetrics(SM_CXVSCROLL
);
1193 lpnm
->iScrollHeight
= GetSystemMetrics(SM_CYHSCROLL
);
1195 /* size of the normal caption buttons */
1196 lpnm
->iCaptionWidth
= GetSystemMetrics(SM_CXSIZE
);
1197 lpnm
->iCaptionHeight
= GetSystemMetrics(SM_CYSIZE
);
1199 /* caption font metrics */
1200 SystemParametersInfoA( SPI_GETICONTITLELOGFONT
, 0, (LPVOID
)&(lpnm
->lfCaptionFont
), 0 );
1201 lpnm
->lfCaptionFont
.lfWeight
= FW_BOLD
;
1203 /* size of the small caption buttons */
1204 lpnm
->iSmCaptionWidth
= GetSystemMetrics(SM_CXSMSIZE
);
1205 lpnm
->iSmCaptionHeight
= GetSystemMetrics(SM_CYSMSIZE
);
1207 /* small caption font metrics */
1208 SystemParametersInfoA( SPI_GETICONTITLELOGFONT
, 0, (LPVOID
)&(lpnm
->lfSmCaptionFont
), 0 );
1210 /* menus, FIXME: names of wine.conf entries are bogus */
1212 /* size of the menu (MDI) buttons */
1213 lpnm
->iMenuWidth
= GetSystemMetrics(SM_CXMENUSIZE
);
1214 lpnm
->iMenuHeight
= GetSystemMetrics(SM_CYMENUSIZE
);
1216 /* menu font metrics */
1217 SystemParametersInfoA( SPI_GETICONTITLELOGFONT
, 0, (LPVOID
)&(lpnm
->lfMenuFont
), 0 );
1218 GetProfileStringA( "Desktop", "MenuFont",
1219 (TWEAK_WineLook
> WIN31_LOOK
) ? lpnm
->lfCaptionFont
.lfFaceName
: "System",
1220 lpnm
->lfMenuFont
.lfFaceName
, LF_FACESIZE
);
1221 lpnm
->lfMenuFont
.lfHeight
= -GetProfileIntA( "Desktop", "MenuFontSize", 11 );
1222 lpnm
->lfMenuFont
.lfWeight
= (TWEAK_WineLook
> WIN31_LOOK
) ? FW_NORMAL
: FW_BOLD
;
1224 /* status bar font metrics */
1225 SystemParametersInfoA( SPI_GETICONTITLELOGFONT
, 0,
1226 (LPVOID
)&(lpnm
->lfStatusFont
), 0 );
1227 /* message font metrics */
1228 SystemParametersInfoA( SPI_GETICONTITLELOGFONT
, 0,
1229 (LPVOID
)&(lpnm
->lfMessageFont
), 0 );
1233 WARN("size mismatch !! (is %d; should be %d)\n", lpnm
->cbSize
, sizeof(NONCLIENTMETRICSA
));
1234 /* FIXME: SetLastError? */
1239 WINE_SPI_FIXME(SPI_SETNONCLIENTMETRICS
); /* 42 WINVER >= 0x400 */
1241 case SPI_GETMINIMIZEDMETRICS
: /* 43 WINVER >= 0x400 */
1243 MINIMIZEDMETRICS
* lpMm
= pvParam
;
1244 if (lpMm
->cbSize
== sizeof(*lpMm
))
1246 /* these taken from Win2k SP3 */
1256 WINE_SPI_FIXME(SPI_SETMINIMIZEDMETRICS
); /* 44 WINVER >= 0x400 */
1258 case SPI_GETICONMETRICS
: /* 45 WINVER >= 0x400 */
1260 LPICONMETRICSA lpIcon
= pvParam
;
1261 if(lpIcon
&& lpIcon
->cbSize
== sizeof(*lpIcon
))
1263 SystemParametersInfoA( SPI_ICONHORIZONTALSPACING
, 0,
1264 &lpIcon
->iHorzSpacing
, FALSE
);
1265 SystemParametersInfoA( SPI_ICONVERTICALSPACING
, 0,
1266 &lpIcon
->iVertSpacing
, FALSE
);
1267 SystemParametersInfoA( SPI_GETICONTITLEWRAP
, 0,
1268 &lpIcon
->iTitleWrap
, FALSE
);
1269 SystemParametersInfoA( SPI_GETICONTITLELOGFONT
, 0,
1270 &lpIcon
->lfFont
, FALSE
);
1278 WINE_SPI_FIXME(SPI_SETICONMETRICS
); /* 46 WINVER >= 0x400 */
1280 case SPI_SETWORKAREA
: /* 47 WINVER >= 0x400 */
1283 RECT
*pr
= (RECT
*) pvParam
;
1285 spi_idx
= SPI_SETWORKAREA_IDX
;
1286 sprintf(buf
, "%ld %ld %ld %ld",
1288 pr
->right
, pr
->bottom
);
1290 if (SYSPARAMS_Save( SPI_SETWORKAREA_REGKEY
,
1291 SPI_SETWORKAREA_VALNAME
,
1294 CopyRect( &work_area
, (RECT
*)pvParam
);
1295 spi_loaded
[spi_idx
] = TRUE
;
1302 case SPI_GETWORKAREA
: /* 48 WINVER >= 0x400 */
1303 spi_idx
= SPI_SETWORKAREA_IDX
;
1304 if (!spi_loaded
[spi_idx
])
1308 SetRect( &work_area
, 0, 0,
1309 GetSystemMetrics( SM_CXSCREEN
),
1310 GetSystemMetrics( SM_CYSCREEN
) );
1312 if (SYSPARAMS_Load( SPI_SETWORKAREA_REGKEY
,
1313 SPI_SETWORKAREA_VALNAME
,
1316 sscanf( buf
, "%ld %ld %ld %ld",
1317 &work_area
.left
, &work_area
.top
,
1318 &work_area
.right
, &work_area
.bottom
);
1320 spi_loaded
[spi_idx
] = TRUE
;
1322 CopyRect( (RECT
*)pvParam
, &work_area
);
1326 WINE_SPI_FIXME(SPI_SETPENWINDOWS
); /* 49 WINVER >= 0x400 */
1328 case SPI_GETFILTERKEYS
: /* 50 */
1330 LPFILTERKEYS lpFilterKeys
= (LPFILTERKEYS
)pvParam
;
1331 WARN("SPI_GETFILTERKEYS not fully implemented\n");
1332 if (lpFilterKeys
->cbSize
== sizeof(FILTERKEYS
))
1334 /* Indicate that no FilterKeys feature available */
1335 lpFilterKeys
->dwFlags
= 0;
1336 lpFilterKeys
->iWaitMSec
= 0;
1337 lpFilterKeys
->iDelayMSec
= 0;
1338 lpFilterKeys
->iRepeatMSec
= 0;
1339 lpFilterKeys
->iBounceMSec
= 0;
1347 WINE_SPI_FIXME(SPI_SETFILTERKEYS
); /* 51 */
1349 case SPI_GETTOGGLEKEYS
: /* 52 */
1351 LPTOGGLEKEYS lpToggleKeys
= (LPTOGGLEKEYS
)pvParam
;
1352 WARN("SPI_GETTOGGLEKEYS not fully implemented\n");
1353 if (lpToggleKeys
->cbSize
== sizeof(TOGGLEKEYS
))
1355 /* Indicate that no ToggleKeys feature available */
1356 lpToggleKeys
->dwFlags
= 0;
1364 WINE_SPI_FIXME(SPI_SETTOGGLEKEYS
); /* 53 */
1366 case SPI_GETMOUSEKEYS
: /* 54 */
1368 LPMOUSEKEYS lpMouseKeys
= (LPMOUSEKEYS
)pvParam
;
1369 WARN("SPI_GETMOUSEKEYS not fully implemented\n");
1370 if (lpMouseKeys
->cbSize
== sizeof(MOUSEKEYS
))
1372 /* Indicate that no MouseKeys feature available */
1373 lpMouseKeys
->dwFlags
= 0;
1374 lpMouseKeys
->iMaxSpeed
= 360;
1375 lpMouseKeys
->iTimeToMaxSpeed
= 1000;
1376 lpMouseKeys
->iCtrlSpeed
= 0;
1377 lpMouseKeys
->dwReserved1
= 0;
1378 lpMouseKeys
->dwReserved2
= 0;
1386 WINE_SPI_FIXME(SPI_SETMOUSEKEYS
); /* 55 */
1388 case SPI_GETSHOWSOUNDS
: /* 56 */
1389 spi_idx
= SPI_SETSHOWSOUNDS_IDX
;
1391 if (!spi_loaded
[spi_idx
])
1395 if (SYSPARAMS_Load( SPI_SETSHOWSOUNDS_REGKEY
,
1396 SPI_SETSHOWSOUNDS_VALNAME
, buf
, sizeof(buf
) ))
1398 SYSMETRICS_Set( SM_SHOWSOUNDS
, atoi( buf
) );
1400 spi_loaded
[spi_idx
] = TRUE
;
1404 *(INT
*)pvParam
= GetSystemMetrics( SM_SHOWSOUNDS
);
1407 case SPI_SETSHOWSOUNDS
: /* 57 */
1410 spi_idx
= SPI_SETSHOWSOUNDS_IDX
;
1412 sprintf(buf
, "%u", uiParam
);
1413 if (SYSPARAMS_Save( SPI_SETSHOWSOUNDS_REGKEY
,
1414 SPI_SETSHOWSOUNDS_VALNAME
,
1417 SYSMETRICS_Set( SM_SHOWSOUNDS
, uiParam
);
1418 spi_loaded
[spi_idx
] = TRUE
;
1425 case SPI_GETSTICKYKEYS
: /* 58 */
1427 LPSTICKYKEYS lpStickyKeys
= (LPSTICKYKEYS
)pvParam
;
1428 WARN("SPI_GETSTICKYKEYS not fully implemented\n");
1429 if (lpStickyKeys
->cbSize
== sizeof(STICKYKEYS
))
1431 /* Indicate that no StickyKeys feature available */
1432 lpStickyKeys
->dwFlags
= 0;
1440 WINE_SPI_FIXME(SPI_SETSTICKYKEYS
); /* 59 */
1442 case SPI_GETACCESSTIMEOUT
: /* 60 */
1444 LPACCESSTIMEOUT lpAccessTimeout
= (LPACCESSTIMEOUT
)pvParam
;
1445 WARN("SPI_GETACCESSTIMEOUT not fully implemented\n");
1446 if (lpAccessTimeout
->cbSize
== sizeof(ACCESSTIMEOUT
))
1448 /* Indicate that no accessibility features timeout is available */
1449 lpAccessTimeout
->dwFlags
= 0;
1450 lpAccessTimeout
->iTimeOutMSec
= 0;
1458 WINE_SPI_FIXME(SPI_SETACCESSTIMEOUT
); /* 61 */
1460 case SPI_GETSERIALKEYS
: /* 62 WINVER >= 0x400 */
1462 LPSERIALKEYSA lpSerialKeysA
= (LPSERIALKEYSA
)pvParam
;
1463 WARN("SPI_GETSERIALKEYS not fully implemented\n");
1464 if (lpSerialKeysA
->cbSize
== sizeof(SERIALKEYSA
))
1466 /* Indicate that no SerialKeys feature available */
1467 lpSerialKeysA
->dwFlags
= 0;
1468 lpSerialKeysA
->lpszActivePort
= NULL
;
1469 lpSerialKeysA
->lpszPort
= NULL
;
1470 lpSerialKeysA
->iBaudRate
= 0;
1471 lpSerialKeysA
->iPortState
= 0;
1479 WINE_SPI_FIXME(SPI_SETSERIALKEYS
); /* 63 WINVER >= 0x400 */
1481 case SPI_GETSOUNDSENTRY
: /* 64 */
1483 LPSOUNDSENTRYA lpSoundSentryA
= (LPSOUNDSENTRYA
)pvParam
;
1484 WARN("SPI_GETSOUNDSENTRY not fully implemented\n");
1485 if (lpSoundSentryA
->cbSize
== sizeof(SOUNDSENTRYA
))
1487 /* Indicate that no SoundSentry feature available */
1488 lpSoundSentryA
->dwFlags
= 0;
1489 lpSoundSentryA
->iFSTextEffect
= 0;
1490 lpSoundSentryA
->iFSTextEffectMSec
= 0;
1491 lpSoundSentryA
->iFSTextEffectColorBits
= 0;
1492 lpSoundSentryA
->iFSGrafEffect
= 0;
1493 lpSoundSentryA
->iFSGrafEffectMSec
= 0;
1494 lpSoundSentryA
->iFSGrafEffectColor
= 0;
1495 lpSoundSentryA
->iWindowsEffect
= 0;
1496 lpSoundSentryA
->iWindowsEffectMSec
= 0;
1497 lpSoundSentryA
->lpszWindowsEffectDLL
= 0;
1498 lpSoundSentryA
->iWindowsEffectOrdinal
= 0;
1506 WINE_SPI_FIXME(SPI_SETSOUNDSENTRY
); /* 65 */
1508 case SPI_GETHIGHCONTRAST
: /* 66 WINVER >= 0x400 */
1510 LPHIGHCONTRASTA lpHighContrastA
= (LPHIGHCONTRASTA
)pvParam
;
1511 WARN("SPI_GETHIGHCONTRAST not fully implemented\n");
1512 if (lpHighContrastA
->cbSize
== sizeof(HIGHCONTRASTA
))
1514 /* Indicate that no high contrast feature available */
1515 lpHighContrastA
->dwFlags
= 0;
1516 lpHighContrastA
->lpszDefaultScheme
= NULL
;
1524 WINE_SPI_FIXME(SPI_SETHIGHCONTRAST
); /* 67 WINVER >= 0x400 */
1526 case SPI_GETKEYBOARDPREF
: /* 68 WINVER >= 0x400 */
1527 spi_idx
= SPI_SETKEYBOARDPREF_IDX
;
1528 if (!spi_loaded
[spi_idx
])
1532 if (SYSPARAMS_Load( SPI_SETKEYBOARDPREF_REGKEY
,
1533 SPI_SETKEYBOARDPREF_VALNAME
, buf
, sizeof(buf
) ))
1534 keyboard_pref
= atoi(buf
);
1535 spi_loaded
[spi_idx
] = TRUE
;
1538 *(BOOL
*)pvParam
= keyboard_pref
;
1541 case SPI_SETKEYBOARDPREF
: /* 69 WINVER >= 0x400 */
1545 spi_idx
= SPI_SETKEYBOARDPREF_IDX
;
1546 sprintf(buf
, "%u", uiParam
);
1547 if (SYSPARAMS_Save( SPI_SETKEYBOARDPREF_REGKEY
,
1548 SPI_SETKEYBOARDPREF_VALNAME
,
1551 keyboard_pref
= uiParam
;
1552 spi_loaded
[spi_idx
] = TRUE
;
1559 case SPI_GETSCREENREADER
: /* 70 WINVER >= 0x400 */
1560 spi_idx
= SPI_SETSCREENREADER_IDX
;
1561 if (!spi_loaded
[spi_idx
])
1565 if (SYSPARAMS_Load( SPI_SETSCREENREADER_REGKEY
,
1566 SPI_SETSCREENREADER_VALNAME
, buf
, sizeof(buf
) ))
1567 screen_reader
= atoi(buf
);
1568 spi_loaded
[spi_idx
] = TRUE
;
1571 *(BOOL
*)pvParam
= screen_reader
;
1574 case SPI_SETSCREENREADER
: /* 71 WINVER >= 0x400 */
1578 spi_idx
= SPI_SETSCREENREADER_IDX
;
1579 sprintf(buf
, "%u", uiParam
);
1580 if (SYSPARAMS_Save( SPI_SETSCREENREADER_REGKEY
,
1581 SPI_SETSCREENREADER_VALNAME
,
1584 screen_reader
= uiParam
;
1585 spi_loaded
[spi_idx
] = TRUE
;
1592 case SPI_GETANIMATION
: /* 72 WINVER >= 0x400 */
1594 LPANIMATIONINFO lpAnimInfo
= (LPANIMATIONINFO
)pvParam
;
1596 /* Tell it "disabled" */
1597 if (lpAnimInfo
->cbSize
== sizeof(ANIMATIONINFO
))
1598 lpAnimInfo
->iMinAnimate
= 0; /* Minimise and restore animation is disabled (nonzero == enabled) */
1603 WINE_SPI_WARN(SPI_SETANIMATION
); /* 73 WINVER >= 0x400 */
1605 WINE_SPI_FIXME(SPI_GETFONTSMOOTHING
); /* 74 WINVER >= 0x400 */
1606 WINE_SPI_FIXME(SPI_SETFONTSMOOTHING
); /* 75 WINVER >= 0x400 */
1608 WINE_SPI_FIXME(SPI_SETDRAGWIDTH
); /* 76 WINVER >= 0x400 */
1609 WINE_SPI_FIXME(SPI_SETDRAGHEIGHT
); /* 77 WINVER >= 0x400 */
1611 WINE_SPI_FIXME(SPI_SETHANDHELD
); /* 78 WINVER >= 0x400 */
1613 WINE_SPI_FIXME(SPI_GETLOWPOWERTIMEOUT
); /* 79 WINVER >= 0x400 */
1614 WINE_SPI_FIXME(SPI_GETPOWEROFFTIMEOUT
); /* 80 WINVER >= 0x400 */
1615 WINE_SPI_FIXME(SPI_SETLOWPOWERTIMEOUT
); /* 81 WINVER >= 0x400 */
1616 WINE_SPI_FIXME(SPI_SETPOWEROFFTIMEOUT
); /* 82 WINVER >= 0x400 */
1617 WINE_SPI_FIXME(SPI_GETLOWPOWERACTIVE
); /* 83 WINVER >= 0x400 */
1618 WINE_SPI_FIXME(SPI_GETPOWEROFFACTIVE
); /* 84 WINVER >= 0x400 */
1619 WINE_SPI_FIXME(SPI_SETLOWPOWERACTIVE
); /* 85 WINVER >= 0x400 */
1620 WINE_SPI_FIXME(SPI_SETPOWEROFFACTIVE
); /* 86 WINVER >= 0x400 */
1622 WINE_SPI_FIXME(SPI_SETCURSORS
); /* 87 WINVER >= 0x400 */
1623 WINE_SPI_FIXME(SPI_SETICONS
); /* 88 WINVER >= 0x400 */
1625 case SPI_GETDEFAULTINPUTLANG
: /* 89 WINVER >= 0x400 */
1626 ret
= GetKeyboardLayout(0) ? TRUE
: FALSE
;
1629 WINE_SPI_FIXME(SPI_SETDEFAULTINPUTLANG
); /* 90 WINVER >= 0x400 */
1631 WINE_SPI_FIXME(SPI_SETLANGTOGGLE
); /* 91 WINVER >= 0x400 */
1633 case SPI_GETWINDOWSEXTENSION
: /* 92 WINVER >= 0x400 */
1634 WARN("pretend no support for Win9x Plus! for now.\n");
1635 ret
= FALSE
; /* yes, this is the result value */
1638 WINE_SPI_FIXME(SPI_SETMOUSETRAILS
); /* 93 WINVER >= 0x400 */
1639 WINE_SPI_FIXME(SPI_GETMOUSETRAILS
); /* 94 WINVER >= 0x400 */
1641 case SPI_SETSCREENSAVERRUNNING
: /* 97 WINVER >= 0x400 */
1643 /* SPI_SCREENSAVERRUNNING is an alias for SPI_SETSCREENSAVERRUNNING */
1646 spi_idx
= SPI_SETSCREENSAVERRUNNING_IDX
;
1647 sprintf(buf
, "%u", uiParam
);
1649 /* save only temporarily */
1650 if (SYSPARAMS_Save( SPI_SETSCREENSAVERRUNNING_REGKEY
,
1651 SPI_SETSCREENSAVERRUNNING_VALNAME
,
1654 screensaver_running
= uiParam
;
1655 spi_loaded
[spi_idx
] = TRUE
;
1662 case SPI_GETMOUSEHOVERWIDTH
: /* 98 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1663 *(UINT
*)pvParam
= 4;
1665 WINE_SPI_FIXME(SPI_SETMOUSEHOVERWIDTH
); /* 99 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1667 case SPI_GETMOUSEHOVERHEIGHT
: /* 100 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1668 *(UINT
*)pvParam
= 4;
1670 WINE_SPI_FIXME(SPI_SETMOUSEHOVERHEIGHT
); /* 101 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1672 case SPI_GETMOUSEHOVERTIME
: /* 102 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1673 *(UINT
*)pvParam
= 400; /* default for menu dropdowns */
1675 WINE_SPI_FIXME(SPI_SETMOUSEHOVERTIME
); /* 103 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1677 case SPI_GETWHEELSCROLLLINES
: /* 104 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1678 *(UINT
*)pvParam
= 3; /* default for num scroll lines */
1681 WINE_SPI_FIXME(SPI_SETWHEELSCROLLLINES
); /* 105 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1683 case SPI_GETMENUSHOWDELAY
: /* 106 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1684 *(UINT
*)pvParam
= 400; /* Tested against Windows NT 4.0 and Windows 2000 */
1687 WINE_SPI_FIXME(SPI_GETSHOWIMEUI
); /* 110 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1688 WINE_SPI_FIXME(SPI_SETSHOWIMEUI
); /* 111 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1690 case SPI_GETSCREENSAVERRUNNING
: /* 114 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1691 spi_idx
= SPI_SETSCREENSAVERRUNNING_IDX
;
1692 if (!spi_loaded
[spi_idx
])
1696 if (SYSPARAMS_Load( SPI_SETSCREENSAVERRUNNING_REGKEY
,
1697 SPI_SETSCREENSAVERRUNNING_VALNAME
, buf
, sizeof(buf
) ))
1698 screensaver_running
= atoi( buf
);
1699 spi_loaded
[spi_idx
] = TRUE
;
1702 *(BOOL
*)pvParam
= screensaver_running
;
1705 case SPI_GETDESKWALLPAPER
: /* 115 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1709 if (uiParam
> MAX_PATH
)
1714 if (SYSPARAMS_Load(SPI_SETDESKWALLPAPER_REGKEY
, SPI_SETDESKWALLPAPER_VALNAME
, buf
, sizeof(buf
)))
1716 strncpy((char*)pvParam
, buf
, uiParam
);
1720 /* Return an empty string */
1721 memset((char*)pvParam
, 0, uiParam
);
1727 WINE_SPI_FIXME(SPI_GETACTIVEWINDOWTRACKING
);/* 0x1000 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1728 WINE_SPI_FIXME(SPI_SETACTIVEWINDOWTRACKING
);/* 0x1001 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1729 WINE_SPI_FIXME(SPI_GETMENUANIMATION
); /* 0x1002 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1730 WINE_SPI_FIXME(SPI_SETMENUANIMATION
); /* 0x1003 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1731 WINE_SPI_FIXME(SPI_GETCOMBOBOXANIMATION
); /* 0x1004 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1732 WINE_SPI_FIXME(SPI_SETCOMBOBOXANIMATION
); /* 0x1005 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1733 WINE_SPI_FIXME(SPI_GETLISTBOXSMOOTHSCROLLING
);/* 0x1006 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1734 WINE_SPI_FIXME(SPI_SETLISTBOXSMOOTHSCROLLING
);/* 0x1007 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1736 case SPI_GETGRADIENTCAPTIONS
: /* 0x1008 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1737 FIXME("case SPI_GETGRADIENTCAPTIONS always return false\n");
1738 *(BOOL
*)pvParam
= FALSE
;
1741 WINE_SPI_FIXME(SPI_SETGRADIENTCAPTIONS
); /* 0x1009 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1742 WINE_SPI_FIXME(SPI_GETKEYBOARDCUES
); /* 0x100A _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1743 WINE_SPI_FIXME(SPI_SETKEYBOARDCUES
); /* 0x100B _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1744 WINE_SPI_FIXME(SPI_GETACTIVEWNDTRKZORDER
); /* 0x100C _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1745 WINE_SPI_FIXME(SPI_SETACTIVEWNDTRKZORDER
); /* 0x100D _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1746 WINE_SPI_FIXME(SPI_GETHOTTRACKING
); /* 0x100E _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1747 WINE_SPI_FIXME(SPI_SETHOTTRACKING
); /* 0x100F _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1748 WINE_SPI_FIXME(SPI_GETSELECTIONFADE
); /* 0x1014 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1749 WINE_SPI_FIXME(SPI_SETSELECTIONFADE
); /* 0x1015 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1750 WINE_SPI_FIXME(SPI_GETDROPSHADOW
); /* 0x1024 _WIN32_WINNT >= 0x510 */
1751 WINE_SPI_FIXME(SPI_SETDROPSHADOW
); /* 0x1025 _WIN32_WINNT >= 0x510 */
1752 WINE_SPI_FIXME(SPI_GETFOREGROUNDLOCKTIMEOUT
);/* 0x2000 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1753 WINE_SPI_FIXME(SPI_SETFOREGROUNDLOCKTIMEOUT
);/* 0x2001 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1754 WINE_SPI_FIXME(SPI_GETACTIVEWNDTRKTIMEOUT
); /* 0x2002 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1755 WINE_SPI_FIXME(SPI_SETACTIVEWNDTRKTIMEOUT
); /* 0x2003 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1756 WINE_SPI_FIXME(SPI_GETFOREGROUNDFLASHCOUNT
);/* 0x2004 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1757 WINE_SPI_FIXME(SPI_SETFOREGROUNDFLASHCOUNT
);/* 0x2005 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1760 FIXME( "Unknown action: %u\n", uiAction
);
1761 SetLastError( ERROR_INVALID_SPI_VALUE
);
1767 SYSPARAMS_NotifyChange( uiAction
, fWinIni
);
1770 #undef WINE_SPI_FIXME
1771 #undef WINE_SPI_WARN
1775 /***********************************************************************
1776 * SystemParametersInfo (USER.483)
1778 BOOL16 WINAPI
SystemParametersInfo16( UINT16 uAction
, UINT16 uParam
,
1779 LPVOID lpvParam
, UINT16 fuWinIni
)
1783 TRACE("(%u, %u, %p, %u)\n", uAction
, uParam
, lpvParam
, fuWinIni
);
1787 case SPI_GETBEEP
: /* 1 */
1788 case SPI_GETSCREENSAVEACTIVE
: /* 16 */
1789 case SPI_GETICONTITLEWRAP
: /* 25 */
1790 case SPI_GETMENUDROPALIGNMENT
: /* 27 */
1791 case SPI_GETFASTTASKSWITCH
: /* 35 */
1792 case SPI_GETDRAGFULLWINDOWS
: /* 38 WINVER >= 0x0400 */
1795 ret
= SystemParametersInfoA( uAction
, uParam
, lpvParam
? &tmp
: NULL
, fuWinIni
);
1796 if (ret
&& lpvParam
)
1797 *(BOOL16
*)lpvParam
= tmp
;
1801 case SPI_GETBORDER
: /* 5 */
1802 case SPI_ICONHORIZONTALSPACING
: /* 13 */
1803 case SPI_GETSCREENSAVETIMEOUT
: /* 14 */
1804 case SPI_GETGRIDGRANULARITY
: /* 18 */
1805 case SPI_GETKEYBOARDDELAY
: /* 22 */
1806 case SPI_ICONVERTICALSPACING
: /* 24 */
1809 ret
= SystemParametersInfoA( uAction
, uParam
, lpvParam
? &tmp
: NULL
, fuWinIni
);
1810 if (ret
&& lpvParam
)
1811 *(INT16
*)lpvParam
= tmp
;
1815 case SPI_GETKEYBOARDSPEED
: /* 10 */
1818 ret
= SystemParametersInfoA( uAction
, uParam
, lpvParam
? &tmp
: NULL
, fuWinIni
);
1819 if (ret
&& lpvParam
)
1820 *(WORD
*)lpvParam
= tmp
;
1824 case SPI_GETICONTITLELOGFONT
: /* 31 */
1827 ret
= SystemParametersInfoA( uAction
, uParam
, lpvParam
? &tmp
: NULL
, fuWinIni
);
1828 if (ret
&& lpvParam
)
1829 SYSPARAMS_LogFont32ATo16( &tmp
, (LPLOGFONT16
)lpvParam
);
1833 case SPI_GETNONCLIENTMETRICS
: /* 41 WINVER >= 0x400 */
1835 NONCLIENTMETRICSA tmp
;
1836 LPNONCLIENTMETRICS16 lpnm16
= (LPNONCLIENTMETRICS16
)lpvParam
;
1837 if (lpnm16
&& lpnm16
->cbSize
== sizeof(NONCLIENTMETRICS16
))
1839 tmp
.cbSize
= sizeof(NONCLIENTMETRICSA
);
1840 ret
= SystemParametersInfoA( uAction
, uParam
, &tmp
, fuWinIni
);
1842 SYSPARAMS_NonClientMetrics32ATo16( &tmp
, lpnm16
);
1844 else /* winfile 95 sets cbSize to 340 */
1845 ret
= SystemParametersInfoA( uAction
, uParam
, lpvParam
, fuWinIni
);
1849 case SPI_GETWORKAREA
: /* 48 WINVER >= 0x400 */
1852 ret
= SystemParametersInfoA( uAction
, uParam
, lpvParam
? &tmp
: NULL
, fuWinIni
);
1853 if (ret
&& lpvParam
)
1854 CONV_RECT32TO16( &tmp
, (RECT16
*)lpvParam
);
1858 case SPI_GETMOUSEHOVERWIDTH
: /* 98 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1859 case SPI_GETMOUSEHOVERHEIGHT
: /* 100 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1860 case SPI_GETMOUSEHOVERTIME
: /* 102 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1863 ret
= SystemParametersInfoA( uAction
, uParam
, lpvParam
? &tmp
: NULL
, fuWinIni
);
1864 if (ret
&& lpvParam
)
1865 *(UINT16
*)lpvParam
= tmp
;
1870 ret
= SystemParametersInfoA( uAction
, uParam
, lpvParam
, fuWinIni
);
1876 /***********************************************************************
1877 * SystemParametersInfoW (USER32.@)
1879 BOOL WINAPI
SystemParametersInfoW( UINT uiAction
, UINT uiParam
,
1880 PVOID pvParam
, UINT fuWinIni
)
1884 TRACE("(%u, %u, %p, %u)\n", uiAction
, uiParam
, pvParam
, fuWinIni
);
1888 case SPI_SETDESKWALLPAPER
: /* 20 */
1889 case SPI_SETDESKPATTERN
: /* 21 */
1893 if (!WideCharToMultiByte( CP_ACP
, 0, (LPWSTR
)pvParam
, -1,
1894 buffer
, sizeof(buffer
), NULL
, NULL
))
1895 buffer
[sizeof(buffer
)-1] = 0;
1896 ret
= SystemParametersInfoA( uiAction
, uiParam
, pvParam
? buffer
: NULL
, fuWinIni
);
1900 case SPI_GETICONTITLELOGFONT
: /* 31 */
1903 ret
= SystemParametersInfoA( uiAction
, uiParam
, pvParam
? &tmp
: NULL
, fuWinIni
);
1905 SYSPARAMS_LogFont32ATo32W( &tmp
, (LPLOGFONTW
)pvParam
);
1909 case SPI_GETNONCLIENTMETRICS
: /* 41 WINVER >= 0x400 */
1911 NONCLIENTMETRICSA tmp
;
1912 LPNONCLIENTMETRICSW lpnmW
= (LPNONCLIENTMETRICSW
)pvParam
;
1913 if (lpnmW
&& lpnmW
->cbSize
== sizeof(NONCLIENTMETRICSW
))
1915 tmp
.cbSize
= sizeof(NONCLIENTMETRICSA
);
1916 ret
= SystemParametersInfoA( uiAction
, uiParam
, &tmp
, fuWinIni
);
1918 SYSPARAMS_NonClientMetrics32ATo32W( &tmp
, lpnmW
);
1925 case SPI_GETICONMETRICS
: /* 45 WINVER >= 0x400 */
1928 LPICONMETRICSW lpimW
= (LPICONMETRICSW
)pvParam
;
1929 if (lpimW
&& lpimW
->cbSize
== sizeof(ICONMETRICSW
))
1931 tmp
.cbSize
= sizeof(ICONMETRICSA
);
1932 ret
= SystemParametersInfoA( uiAction
, uiParam
, &tmp
, fuWinIni
);
1935 lpimW
->iHorzSpacing
= tmp
.iHorzSpacing
;
1936 lpimW
->iVertSpacing
= tmp
.iVertSpacing
;
1937 lpimW
->iTitleWrap
= tmp
.iTitleWrap
;
1938 SYSPARAMS_LogFont32ATo32W( &tmp
.lfFont
, &lpimW
->lfFont
);
1946 case SPI_GETHIGHCONTRAST
: /* 66 WINVER >= 0x400 */
1949 LPHIGHCONTRASTW lphcW
= (LPHIGHCONTRASTW
)pvParam
;
1950 if (lphcW
&& lphcW
->cbSize
== sizeof(HIGHCONTRASTW
))
1952 tmp
.cbSize
= sizeof(HIGHCONTRASTA
);
1953 ret
= SystemParametersInfoA( uiAction
, uiParam
, &tmp
, fuWinIni
);
1956 lphcW
->dwFlags
= tmp
.dwFlags
;
1957 lphcW
->lpszDefaultScheme
= NULL
; /* FIXME? */
1966 ret
= SystemParametersInfoA( uiAction
, uiParam
, pvParam
, fuWinIni
);
1973 /**********************************************************************
1974 * SetDoubleClickTime (USER32.@)
1976 BOOL WINAPI
SetDoubleClickTime( UINT interval
)
1978 return SystemParametersInfoA(SPI_SETDOUBLECLICKTIME
, interval
, 0, 0);
1982 /**********************************************************************
1983 * GetDoubleClickTime (USER32.@)
1985 UINT WINAPI
GetDoubleClickTime(void)
1989 if (!spi_loaded
[SPI_SETDOUBLECLICKTIME_IDX
])
1991 if (SYSPARAMS_Load( SPI_SETDOUBLECLICKTIME_REGKEY
,
1992 SPI_SETDOUBLECLICKTIME_VALNAME
,
1995 double_click_time
= atoi( buf
);
1996 if (!double_click_time
) double_click_time
= 500;
1998 spi_loaded
[SPI_SETDOUBLECLICKTIME_IDX
] = TRUE
;
2000 return double_click_time
;