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
32 #include "wine/winuser16.h"
37 #include "wine/unicode.h"
38 #include "wine/debug.h"
40 WINE_DEFAULT_DEBUG_CHANNEL(system
);
42 /* System parameter indexes */
43 #define SPI_SETBEEP_IDX 0
44 #define SPI_SETMOUSE_IDX 1
45 #define SPI_SETBORDER_IDX 2
46 #define SPI_SETKEYBOARDSPEED_IDX 3
47 #define SPI_ICONHORIZONTALSPACING_IDX 4
48 #define SPI_SETSCREENSAVETIMEOUT_IDX 5
49 #define SPI_SETGRIDGRANULARITY_IDX 6
50 #define SPI_SETKEYBOARDDELAY_IDX 7
51 #define SPI_ICONVERTICALSPACING_IDX 8
52 #define SPI_SETICONTITLEWRAP_IDX 9
53 #define SPI_SETMENUDROPALIGNMENT_IDX 10
54 #define SPI_SETDOUBLECLKWIDTH_IDX 11
55 #define SPI_SETDOUBLECLKHEIGHT_IDX 12
56 #define SPI_SETDOUBLECLICKTIME_IDX 13
57 #define SPI_SETMOUSEBUTTONSWAP_IDX 14
58 #define SPI_SETDRAGFULLWINDOWS_IDX 15
59 #define SPI_SETWORKAREA_IDX 16
60 #define SPI_SETSHOWSOUNDS_IDX 17
61 #define SPI_SETKEYBOARDPREF_IDX 18
62 #define SPI_SETSCREENREADER_IDX 19
63 #define SPI_SETSCREENSAVERRUNNING_IDX 20
64 #define SPI_SETFONTSMOOTHING_IDX 21
65 #define SPI_SETKEYBOARDCUES_IDX 22
66 #define SPI_SETGRADIENTCAPTIONS_IDX 23
67 #define SPI_SETHOTTRACKING_IDX 24
68 #define SPI_SETLISTBOXSMOOTHSCROLLING_IDX 25
69 #define SPI_SETMOUSEHOVERWIDTH_IDX 26
70 #define SPI_SETMOUSEHOVERHEIGHT_IDX 27
71 #define SPI_SETMOUSEHOVERTIME_IDX 28
72 #define SPI_SETMOUSESCROLLLINES_IDX 29
73 #define SPI_SETMENUSHOWDELAY_IDX 30
75 #define SPI_WINE_IDX SPI_SETMENUSHOWDELAY_IDX
78 * Names of the registry subkeys of HKEY_CURRENT_USER key and value names
79 * for the system parameters.
80 * Names of the keys are created by adding string "_REGKEY" to
81 * "SET" action names, value names are created by adding "_REG_NAME"
82 * to the "SET" action name.
84 static const WCHAR SPI_SETBEEP_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','S','o','u','n','d',0};
85 static const WCHAR SPI_SETBEEP_VALNAME
[]= {'B','e','e','p',0};
86 static const WCHAR SPI_SETMOUSE_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','M','o','u','s','e',0};
87 static const WCHAR SPI_SETMOUSE_VALNAME1
[]= {'M','o','u','s','e','T','h','r','e','s','h','o','l','d','1',0};
88 static const WCHAR SPI_SETMOUSE_VALNAME2
[]= {'M','o','u','s','e','T','h','r','e','s','h','o','l','d','2',0};
89 static const WCHAR SPI_SETMOUSE_VALNAME3
[]= {'M','o','u','s','e','S','p','e','e','d',0};
90 static const WCHAR SPI_SETBORDER_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0};
91 static const WCHAR SPI_SETBORDER_VALNAME
[]= {'B','o','r','d','e','r','W','i','d','t','h',0};
92 static const WCHAR SPI_SETKEYBOARDSPEED_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','K','e','y','b','o','a','r','d',0};
93 static const WCHAR SPI_SETKEYBOARDSPEED_VALNAME
[]= {'K','e','y','b','o','a','r','d','S','p','e','e','d',0};
94 static const WCHAR SPI_ICONHORIZONTALSPACING_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p','\\',
95 'W','i','n','d','o','w','M','e','t','r','i','c','s',0};
96 static const WCHAR SPI_ICONHORIZONTALSPACING_VALNAME
[]= {'I','c','o','n','S','p','a','c','i','n','g',0};
97 static const WCHAR SPI_SETSCREENSAVETIMEOUT_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0};
98 static const WCHAR SPI_SETSCREENSAVETIMEOUT_VALNAME
[]= {'S','c','r','e','e','n','S','a','v','e','T','i','m','e','O','u','t',0};
99 static const WCHAR SPI_SETSCREENSAVEACTIVE_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0};
100 static const WCHAR SPI_SETSCREENSAVEACTIVE_VALNAME
[]= {'S','c','r','e','e','n','S','a','v','e','A','c','t','i','v','e',0};
101 static const WCHAR SPI_SETGRIDGRANULARITY_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0};
102 static const WCHAR SPI_SETGRIDGRANULARITY_VALNAME
[]= {'G','r','i','d','G','r','a','n','u','l','a','r','i','t','y',0};
103 static const WCHAR SPI_SETKEYBOARDDELAY_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','K','e','y','b','o','a','r','d',0};
104 static const WCHAR SPI_SETKEYBOARDDELAY_VALNAME
[]= {'K','e','y','b','o','a','r','d','D','e','l','a','y',0};
105 static const WCHAR SPI_ICONVERTICALSPACING_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p','\\',
106 'W','i','n','d','o','w','M','e','t','r','i','c','s',0};
107 static const WCHAR SPI_ICONVERTICALSPACING_VALNAME
[]= {'I','c','o','n','V','e','r','t','i','c','a','l','S','p','a','c','i','n','g',0};
108 static const WCHAR SPI_SETICONTITLEWRAP_REGKEY1
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p','\\',
109 'W','i','n','d','o','w','M','e','t','r','i','c','s',0};
110 static const WCHAR SPI_SETICONTITLEWRAP_REGKEY2
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0};
111 static const WCHAR SPI_SETICONTITLEWRAP_VALNAME
[]= {'I','c','o','n','T','i','t','l','e','W','r','a','p',0};
112 static const WCHAR SPI_SETMENUDROPALIGNMENT_REGKEY1
[]= {'S','o','f','t','w','a','r','e','\\',
113 'M','i','c','r','o','s','o','f','t','\\',
114 'W','i','n','d','o','w','s',' ','N','T','\\',
115 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
116 'W','i','n','d','o','w','s',0};
117 static const WCHAR SPI_SETMENUDROPALIGNMENT_REGKEY2
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0};
118 static const WCHAR SPI_SETMENUDROPALIGNMENT_VALNAME
[]= {'M','e','n','u','D','r','o','p','A','l','i','g','n','m','e','n','t',0};
119 static const WCHAR SPI_SETDOUBLECLKWIDTH_REGKEY1
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','M','o','u','s','e',0};
120 static const WCHAR SPI_SETDOUBLECLKWIDTH_REGKEY2
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0};
121 static const WCHAR SPI_SETDOUBLECLKWIDTH_VALNAME
[]= {'D','o','u','b','l','e','C','l','i','c','k','W','i','d','t','h',0};
122 static const WCHAR SPI_SETDOUBLECLKHEIGHT_REGKEY1
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','M','o','u','s','e',0};
123 static const WCHAR SPI_SETDOUBLECLKHEIGHT_REGKEY2
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0};
124 static const WCHAR SPI_SETDOUBLECLKHEIGHT_VALNAME
[]= {'D','o','u','b','l','e','C','l','i','c','k','H','e','i','g','h','t',0};
125 static const WCHAR SPI_SETDOUBLECLICKTIME_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','M','o','u','s','e',0};
126 static const WCHAR SPI_SETDOUBLECLICKTIME_VALNAME
[]= {'D','o','u','b','l','e','C','l','i','c','k','S','p','e','e','d',0};
127 static const WCHAR SPI_SETMOUSEBUTTONSWAP_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','M','o','u','s','e',0};
128 static const WCHAR SPI_SETMOUSEBUTTONSWAP_VALNAME
[]= {'S','w','a','p','M','o','u','s','e','B','u','t','t','o','n','s',0};
129 static const WCHAR SPI_SETDRAGFULLWINDOWS_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0};
130 static const WCHAR SPI_SETDRAGFULLWINDOWS_VALNAME
[]= {'D','r','a','g','F','u','l','l','W','i','n','d','o','w','s',0};
131 static const WCHAR SPI_SETWORKAREA_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0};
132 static const WCHAR SPI_SETWORKAREA_VALNAME
[]= {'W','I','N','E','_','W','o','r','k','A','r','e','a',0};
133 static const WCHAR SPI_SETSHOWSOUNDS_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\',
134 'A','c','c','e','s','s','i','b','i','l','i','t','y','\\',
135 'S','h','o','w','S','o','u','n','d','s',0};
136 static const WCHAR SPI_SETSHOWSOUNDS_VALNAME
[]= {'O','n',0};
137 static const WCHAR SPI_SETDESKWALLPAPER_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0};
138 static const WCHAR SPI_SETDESKWALLPAPER_VALNAME
[]= {'W','a','l','l','p','a','p','e','r',0};
139 static const WCHAR SPI_SETFONTSMOOTHING_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0};
140 static const WCHAR SPI_SETFONTSMOOTHING_VALNAME
[]= {'F','o','n','t','S','m','o','o','t','h','i','n','g',0};
141 static const WCHAR SPI_USERPREFERENCEMASK_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0};
142 static const WCHAR SPI_USERPREFERENCEMASK_VALNAME
[]= {'U','s','e','r','P','r','e','f','e','r','e','n','c','e','m','a','s','k',0};
143 static const WCHAR SPI_SETLISTBOXSMOOTHSCROLLING_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0};
144 static const WCHAR SPI_SETLISTBOXSMOOTHSCROLLING_VALNAME
[]= {'S','m','o','o','t','h','S','c','r','o','l','l',0};
145 static const WCHAR SPI_SETMOUSEHOVERWIDTH_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','M','o','u','s','e',0};
146 static const WCHAR SPI_SETMOUSEHOVERWIDTH_VALNAME
[]= {'M','o','u','s','e','H','o','v','e','r','W','i','d','t','h',0};
147 static const WCHAR SPI_SETMOUSEHOVERHEIGHT_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','M','o','u','s','e',0};
148 static const WCHAR SPI_SETMOUSEHOVERHEIGHT_VALNAME
[]= {'M','o','u','s','e','H','o','v','e','r','H','e','i','g','h','t',0};
149 static const WCHAR SPI_SETMOUSEHOVERTIME_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','M','o','u','s','e',0};
150 static const WCHAR SPI_SETMOUSEHOVERTIME_VALNAME
[]= {'M','o','u','s','e','H','o','v','e','r','T','i','m','e',0};
151 static const WCHAR SPI_SETMOUSESCROLLLINES_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0};
152 static const WCHAR SPI_SETMOUSESCROLLLINES_VALNAME
[]= {'W','h','e','e','l','S','c','r','o','l','l','L','i','n','e','s',0};
153 static const WCHAR SPI_SETMENUSHOWDELAY_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0};
154 static const WCHAR SPI_SETMENUSHOWDELAY_VALNAME
[]= {'M','e','n','u','S','h','o','w','D','e','l','a','y',0};
156 /* FIXME - real values */
157 static const WCHAR SPI_SETKEYBOARDPREF_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0};
158 static const WCHAR SPI_SETKEYBOARDPREF_VALNAME
[]= {'W','I','N','E','_','K','e','y','b','o','a','r','d','P','r','e','f',0};
159 static const WCHAR SPI_SETSCREENREADER_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0};
160 static const WCHAR SPI_SETSCREENREADER_VALNAME
[]= {'W','I','N','E','_','S','c','r','e','e','n','R','e','a','d','e','r',0};
161 static const WCHAR SPI_SETSCREENSAVERRUNNING_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0};
162 static const WCHAR SPI_SETSCREENSAVERRUNNING_VALNAME
[]= {'W','I','N','E','_','S','c','r','e','e','n','S','a','v','e','r','R','u','n','n','i','n','g',0};
164 /* volatile registry branch under CURRENT_USER_REGKEY for temporary values storage */
165 static const WCHAR WINE_CURRENT_USER_REGKEY
[] = {'W','i','n','e',0};
168 static const WCHAR Yes
[]= {'Y','e','s',0};
169 static const WCHAR No
[]= {'N','o',0};
170 static const WCHAR Desktop
[]= {'D','e','s','k','t','o','p',0};
171 static const WCHAR Pattern
[]= {'P','a','t','t','e','r','n',0};
172 static const WCHAR MenuFont
[]= {'M','e','n','u','F','o','n','t',0};
173 static const WCHAR MenuFontSize
[]= {'M','e','n','u','F','o','n','t','S','i','z','e',0};
174 static const WCHAR System
[]= {'S','y','s','t','e','m',0};
175 static const WCHAR IconTitleSize
[]= {'I','c','o','n','T','i','t','l','e','S','i','z','e',0};
176 static const WCHAR IconTitleFaceName
[]= {'I','c','o','n','T','i','t','l','e','F','a','c','e','N','a','m','e',0};
177 static const WCHAR defPattern
[]= {'1','7','0',' ','8','5',' ','1','7','0',' ','8','5',' ','1','7','0',' ','8','5',
178 ' ','1','7','0',' ','8','5',0};
179 static const WCHAR CSu
[]= {'%','u',0};
180 static const WCHAR CSd
[]= {'%','d',0};
182 /* Indicators whether system parameter value is loaded */
183 static char spi_loaded
[SPI_WINE_IDX
+ 1];
185 static BOOL notify_change
= TRUE
;
187 /* System parameters storage */
188 static BOOL beep_active
= TRUE
;
189 static int mouse_threshold1
= 6;
190 static int mouse_threshold2
= 10;
191 static int mouse_speed
= 1;
192 static int border
= 1;
193 static int keyboard_speed
= 31;
194 static int screensave_timeout
= 300;
195 static int grid_granularity
= 0;
196 static int keyboard_delay
= 1;
197 static BOOL icon_title_wrap
= TRUE
;
198 static int double_click_time
= 500;
199 static BOOL drag_full_windows
= FALSE
;
200 static RECT work_area
;
201 static BOOL keyboard_pref
= TRUE
;
202 static BOOL screen_reader
= FALSE
;
203 static int mouse_hover_width
= 4;
204 static int mouse_hover_height
= 4;
205 static int mouse_hover_time
= 400;
206 static int mouse_scroll_lines
= 3;
207 static int menu_show_delay
= 400;
208 static BOOL screensaver_running
= FALSE
;
209 static BOOL font_smoothing
= FALSE
;
210 static BOOL keyboard_cues
= FALSE
;
211 static BOOL gradient_captions
= FALSE
;
212 static BOOL listbox_smoothscrolling
= FALSE
;
213 static BOOL hot_tracking
= FALSE
;
215 /***********************************************************************
216 * GetTimerResolution (USER.14)
218 LONG WINAPI
GetTimerResolution16(void)
223 /***********************************************************************
224 * ControlPanelInfo (USER.273)
226 void WINAPI
ControlPanelInfo16( INT16 nInfoType
, WORD wData
, LPSTR lpBuffer
)
228 FIXME("(%d, %04x, %p): stub.\n", nInfoType
, wData
, lpBuffer
);
231 /* This function is a copy of the one in objects/font.c */
232 static void SYSPARAMS_LogFont32ATo16( const LOGFONTA
* font32
, LPLOGFONT16 font16
)
234 font16
->lfHeight
= font32
->lfHeight
;
235 font16
->lfWidth
= font32
->lfWidth
;
236 font16
->lfEscapement
= font32
->lfEscapement
;
237 font16
->lfOrientation
= font32
->lfOrientation
;
238 font16
->lfWeight
= font32
->lfWeight
;
239 font16
->lfItalic
= font32
->lfItalic
;
240 font16
->lfUnderline
= font32
->lfUnderline
;
241 font16
->lfStrikeOut
= font32
->lfStrikeOut
;
242 font16
->lfCharSet
= font32
->lfCharSet
;
243 font16
->lfOutPrecision
= font32
->lfOutPrecision
;
244 font16
->lfClipPrecision
= font32
->lfClipPrecision
;
245 font16
->lfQuality
= font32
->lfQuality
;
246 font16
->lfPitchAndFamily
= font32
->lfPitchAndFamily
;
247 lstrcpynA( font16
->lfFaceName
, font32
->lfFaceName
, LF_FACESIZE
);
250 static void SYSPARAMS_LogFont32WTo32A( const LOGFONTW
* font32W
, LPLOGFONTA font32A
)
252 font32A
->lfHeight
= font32W
->lfHeight
;
253 font32A
->lfWidth
= font32W
->lfWidth
;
254 font32A
->lfEscapement
= font32W
->lfEscapement
;
255 font32A
->lfOrientation
= font32W
->lfOrientation
;
256 font32A
->lfWeight
= font32W
->lfWeight
;
257 font32A
->lfItalic
= font32W
->lfItalic
;
258 font32A
->lfUnderline
= font32W
->lfUnderline
;
259 font32A
->lfStrikeOut
= font32W
->lfStrikeOut
;
260 font32A
->lfCharSet
= font32W
->lfCharSet
;
261 font32A
->lfOutPrecision
= font32W
->lfOutPrecision
;
262 font32A
->lfClipPrecision
= font32W
->lfClipPrecision
;
263 font32A
->lfQuality
= font32W
->lfQuality
;
264 font32A
->lfPitchAndFamily
= font32W
->lfPitchAndFamily
;
265 WideCharToMultiByte( CP_ACP
, 0, font32W
->lfFaceName
, -1, font32A
->lfFaceName
, LF_FACESIZE
, NULL
, NULL
);
266 font32A
->lfFaceName
[LF_FACESIZE
-1] = 0;
269 static void SYSPARAMS_NonClientMetrics32ATo16( const NONCLIENTMETRICSA
* lpnm32
, LPNONCLIENTMETRICS16 lpnm16
)
271 lpnm16
->iBorderWidth
= lpnm32
->iBorderWidth
;
272 lpnm16
->iScrollWidth
= lpnm32
->iScrollWidth
;
273 lpnm16
->iScrollHeight
= lpnm32
->iScrollHeight
;
274 lpnm16
->iCaptionWidth
= lpnm32
->iCaptionWidth
;
275 lpnm16
->iCaptionHeight
= lpnm32
->iCaptionHeight
;
276 SYSPARAMS_LogFont32ATo16( &lpnm32
->lfCaptionFont
, &lpnm16
->lfCaptionFont
);
277 lpnm16
->iSmCaptionWidth
= lpnm32
->iSmCaptionWidth
;
278 lpnm16
->iSmCaptionHeight
= lpnm32
->iSmCaptionHeight
;
279 SYSPARAMS_LogFont32ATo16( &lpnm32
->lfSmCaptionFont
, &lpnm16
->lfSmCaptionFont
);
280 lpnm16
->iMenuWidth
= lpnm32
->iMenuWidth
;
281 lpnm16
->iMenuHeight
= lpnm32
->iMenuHeight
;
282 SYSPARAMS_LogFont32ATo16( &lpnm32
->lfMenuFont
, &lpnm16
->lfMenuFont
);
283 SYSPARAMS_LogFont32ATo16( &lpnm32
->lfStatusFont
, &lpnm16
->lfStatusFont
);
284 SYSPARAMS_LogFont32ATo16( &lpnm32
->lfMessageFont
, &lpnm16
->lfMessageFont
);
287 static void SYSPARAMS_NonClientMetrics32WTo32A( const NONCLIENTMETRICSW
* lpnm32W
, LPNONCLIENTMETRICSA lpnm32A
)
289 lpnm32A
->iBorderWidth
= lpnm32W
->iBorderWidth
;
290 lpnm32A
->iScrollWidth
= lpnm32W
->iScrollWidth
;
291 lpnm32A
->iScrollHeight
= lpnm32W
->iScrollHeight
;
292 lpnm32A
->iCaptionWidth
= lpnm32W
->iCaptionWidth
;
293 lpnm32A
->iCaptionHeight
= lpnm32W
->iCaptionHeight
;
294 SYSPARAMS_LogFont32WTo32A( &lpnm32W
->lfCaptionFont
, &lpnm32A
->lfCaptionFont
);
295 lpnm32A
->iSmCaptionWidth
= lpnm32W
->iSmCaptionWidth
;
296 lpnm32A
->iSmCaptionHeight
= lpnm32W
->iSmCaptionHeight
;
297 SYSPARAMS_LogFont32WTo32A( &lpnm32W
->lfSmCaptionFont
, &lpnm32A
->lfSmCaptionFont
);
298 lpnm32A
->iMenuWidth
= lpnm32W
->iMenuWidth
;
299 lpnm32A
->iMenuHeight
= lpnm32W
->iMenuHeight
;
300 SYSPARAMS_LogFont32WTo32A( &lpnm32W
->lfMenuFont
, &lpnm32A
->lfMenuFont
);
301 SYSPARAMS_LogFont32WTo32A( &lpnm32W
->lfStatusFont
, &lpnm32A
->lfStatusFont
);
302 SYSPARAMS_LogFont32WTo32A( &lpnm32W
->lfMessageFont
, &lpnm32A
->lfMessageFont
);
305 /***********************************************************************
308 * Sets the system parameter which should be always loaded to
309 * current value stored in registry.
310 * Invalidates lazy loaded parameter, so it will be loaded the next time
314 * uiAction - system parameter to reload value for.
315 * Note, only "SET" values can be used for this parameter.
316 * If uiAction is 0 all system parameters are reset.
318 void SYSPARAMS_Reset( UINT uiAction
)
320 #define WINE_RELOAD_SPI(x) \
322 spi_loaded[x##_IDX] = FALSE; \
323 SystemParametersInfoA( x, 0, dummy_buf, 0 );\
327 #define WINE_IGNORE_SPI(x) \
332 #define WINE_INVALIDATE_SPI(x) \
334 spi_loaded[x##_IDX] = FALSE; \
337 BOOL not_all_processed
= TRUE
;
340 /* Execution falls through all the branches for uiAction == 0 */
344 memset( spi_loaded
, 0, sizeof(spi_loaded
) );
346 WINE_RELOAD_SPI(SPI_SETBORDER
);
347 WINE_RELOAD_SPI(SPI_ICONHORIZONTALSPACING
);
348 WINE_RELOAD_SPI(SPI_ICONVERTICALSPACING
);
349 WINE_IGNORE_SPI(SPI_SETSCREENSAVEACTIVE
);
350 WINE_RELOAD_SPI(SPI_SETDOUBLECLKWIDTH
);
351 WINE_RELOAD_SPI(SPI_SETDOUBLECLKHEIGHT
);
352 WINE_RELOAD_SPI(SPI_SETMOUSEBUTTONSWAP
);
353 WINE_RELOAD_SPI(SPI_SETSHOWSOUNDS
);
354 WINE_RELOAD_SPI(SPI_SETMENUDROPALIGNMENT
);
359 /* lazy loaded parameters */
362 WINE_INVALIDATE_SPI(SPI_SETBEEP
);
363 WINE_INVALIDATE_SPI(SPI_SETMOUSE
);
364 WINE_INVALIDATE_SPI(SPI_SETKEYBOARDSPEED
);
365 WINE_INVALIDATE_SPI(SPI_SETSCREENSAVETIMEOUT
);
366 WINE_INVALIDATE_SPI(SPI_SETGRIDGRANULARITY
);
367 WINE_INVALIDATE_SPI(SPI_SETKEYBOARDDELAY
);
368 WINE_INVALIDATE_SPI(SPI_SETICONTITLEWRAP
);
369 WINE_INVALIDATE_SPI(SPI_SETDOUBLECLICKTIME
);
370 WINE_INVALIDATE_SPI(SPI_SETDRAGFULLWINDOWS
);
371 WINE_INVALIDATE_SPI(SPI_SETWORKAREA
);
372 WINE_INVALIDATE_SPI(SPI_SETKEYBOARDPREF
);
373 WINE_INVALIDATE_SPI(SPI_SETSCREENREADER
);
374 WINE_INVALIDATE_SPI(SPI_SETSCREENSAVERRUNNING
);
376 FIXME( "Unknown action reset: %u\n", uiAction
);
381 not_all_processed
= FALSE
;
385 if (!uiAction
&& not_all_processed
)
386 ERR( "Incorrect implementation of SYSPARAMS_Reset. "
387 "Not all params are reloaded.\n" );
388 #undef WINE_INVALIDATE_SPI
389 #undef WINE_IGNORE_SPI
390 #undef WINE_RELOAD_SPI
393 /***********************************************************************
394 * get_volatile_regkey
396 * Return a handle to the volatile registry key used to store
397 * non-permanently modified parameters.
399 static HKEY
get_volatile_regkey(void)
401 static HKEY volatile_key
;
405 if (RegCreateKeyExW( HKEY_CURRENT_USER
, WINE_CURRENT_USER_REGKEY
,
406 0, 0, REG_OPTION_VOLATILE
, KEY_ALL_ACCESS
, 0,
407 &volatile_key
, 0 ) != ERROR_SUCCESS
)
408 ERR("Can't create wine configuration registry branch\n");
413 /***********************************************************************
414 * SYSPARAMS_NotifyChange
416 * Sends notification about system parameter update.
418 void SYSPARAMS_NotifyChange( UINT uiAction
, UINT fWinIni
)
420 static const WCHAR emptyW
[1];
424 if (fWinIni
& SPIF_UPDATEINIFILE
)
426 if (fWinIni
& (SPIF_SENDWININICHANGE
| SPIF_SENDCHANGE
))
427 SendMessageTimeoutW(HWND_BROADCAST
, WM_SETTINGCHANGE
,
428 uiAction
, (LPARAM
) emptyW
,
429 SMTO_ABORTIFHUNG
, 2000, NULL
);
433 /* FIXME notify other wine processes with internal message */
439 /***********************************************************************
440 * Loads system parameter from user profile.
442 static BOOL
SYSPARAMS_Load( LPCWSTR lpRegKey
, LPCWSTR lpValName
, LPWSTR lpBuf
, DWORD count
)
448 if ((RegOpenKeyW( get_volatile_regkey(), lpRegKey
, &hKey
) == ERROR_SUCCESS
) ||
449 (RegOpenKeyW( HKEY_CURRENT_USER
, lpRegKey
, &hKey
) == ERROR_SUCCESS
))
451 ret
= !RegQueryValueExW( hKey
, lpValName
, NULL
, &type
, (LPBYTE
)lpBuf
, &count
);
457 /***********************************************************************
458 * Saves system parameter to user profile.
460 static BOOL
SYSPARAMS_Save( LPCWSTR lpRegKey
, LPCWSTR lpValName
, LPCWSTR lpValue
,
468 if (fWinIni
& SPIF_UPDATEINIFILE
)
470 hBaseKey
= HKEY_CURRENT_USER
;
475 hBaseKey
= get_volatile_regkey();
476 dwOptions
= REG_OPTION_VOLATILE
;
479 if (RegCreateKeyExW( hBaseKey
, lpRegKey
,
480 0, 0, dwOptions
, KEY_ALL_ACCESS
,
481 0, &hKey
, 0 ) == ERROR_SUCCESS
)
483 if (RegSetValueExW( hKey
, lpValName
, 0, REG_SZ
,
484 (const BYTE
*)lpValue
,
485 (strlenW(lpValue
) + 1)*sizeof(WCHAR
)) == ERROR_SUCCESS
)
488 if (hBaseKey
== HKEY_CURRENT_USER
)
489 RegDeleteKeyW( get_volatile_regkey(), lpRegKey
);
497 /***********************************************************************
498 * SYSPARAMS_GetDoubleClickSize
500 * There is no SPI_GETDOUBLECLK* so we export this function instead.
502 void SYSPARAMS_GetDoubleClickSize( INT
*width
, INT
*height
)
506 if (!spi_loaded
[SPI_SETDOUBLECLKWIDTH_IDX
])
508 if (SYSPARAMS_Load( SPI_SETDOUBLECLKWIDTH_REGKEY1
,
509 SPI_SETDOUBLECLKWIDTH_VALNAME
, buf
, sizeof(buf
) ))
511 SYSMETRICS_Set( SM_CXDOUBLECLK
, atoiW( buf
) );
513 spi_loaded
[SPI_SETDOUBLECLKWIDTH_IDX
] = TRUE
;
515 if (!spi_loaded
[SPI_SETDOUBLECLKHEIGHT_IDX
])
517 if (SYSPARAMS_Load( SPI_SETDOUBLECLKHEIGHT_REGKEY1
,
518 SPI_SETDOUBLECLKHEIGHT_VALNAME
, buf
, sizeof(buf
) ))
520 SYSMETRICS_Set( SM_CYDOUBLECLK
, atoiW( buf
) );
522 spi_loaded
[SPI_SETDOUBLECLKHEIGHT_IDX
] = TRUE
;
524 *width
= GetSystemMetrics( SM_CXDOUBLECLK
);
525 *height
= GetSystemMetrics( SM_CYDOUBLECLK
);
529 /***********************************************************************
530 * SYSPARAMS_GetMouseButtonSwap
532 * There is no SPI_GETMOUSEBUTTONSWAP so we export this function instead.
534 INT
SYSPARAMS_GetMouseButtonSwap( void )
536 int spi_idx
= SPI_SETMOUSEBUTTONSWAP_IDX
;
538 if (!spi_loaded
[spi_idx
])
542 if (SYSPARAMS_Load( SPI_SETMOUSEBUTTONSWAP_REGKEY
,
543 SPI_SETMOUSEBUTTONSWAP_VALNAME
, buf
, sizeof(buf
) ))
545 SYSMETRICS_Set( SM_SWAPBUTTON
, atoiW( buf
) );
547 spi_loaded
[spi_idx
] = TRUE
;
550 return GetSystemMetrics( SM_SWAPBUTTON
);
553 /***********************************************************************
555 * SYSPARAMS_GetGUIFont
557 * fills LOGFONT with 'default GUI font'.
560 static void SYSPARAMS_GetGUIFont( LOGFONTW
* plf
)
564 memset( plf
, 0, sizeof(LOGFONTW
) );
565 hf
= (HFONT
)GetStockObject( DEFAULT_GUI_FONT
);
566 if ( GetObjectW( hf
, sizeof(LOGFONTW
), plf
) != sizeof(LOGFONTW
) )
569 * GetObjectW() would be succeeded always
570 * since this is a stock object
572 ERR("GetObjectW() failed\n");
576 /* copied from GetSystemMetrics()'s RegistryTwips2Pixels() */
577 inline static int SYSPARAMS_Twips2Pixels(int x
)
584 /***********************************************************************
585 * SystemParametersInfoW (USER32.@)
587 * Each system parameter has flag which shows whether the parameter
588 * is loaded or not. Parameters, stored directly in SysParametersInfo are
589 * loaded from registry only when they are requested and the flag is
590 * "false", after the loading the flag is set to "true". On interprocess
591 * notification of the parameter change the corresponding parameter flag is
592 * set to "false". The parameter value will be reloaded when it is requested
594 * Parameters, backed by or depend on GetSystemMetrics are processed
595 * differently. These parameters are always loaded. They are reloaded right
596 * away on interprocess change notification. We can't do lazy loading because
597 * we don't want to complicate GetSystemMetrics.
598 * Parameters, backed by X settings are read from corresponding setting.
599 * On the parameter change request the setting is changed. Interprocess change
600 * notifications are ignored.
601 * When parameter value is updated the changed value is stored in permanent
602 * registry branch if saving is requested. Otherwise it is stored
603 * in temporary branch
605 * Some SPI values can also be stored as Twips values in the registry,
606 * don't forget the conversion!
608 BOOL WINAPI
SystemParametersInfoW( UINT uiAction
, UINT uiParam
,
609 PVOID pvParam
, UINT fWinIni
)
611 #define WINE_SPI_FIXME(x) \
613 FIXME( "Unimplemented action: %u (%s)\n", x, #x ); \
614 SetLastError( ERROR_INVALID_SPI_VALUE ); \
617 #define WINE_SPI_WARN(x) \
619 WARN( "Ignored action: %u (%s)\n", x, #x ); \
623 unsigned spi_idx
= 0;
625 TRACE("(%u, %u, %p, %u)\n", uiAction
, uiParam
, pvParam
, fWinIni
);
629 case SPI_GETBEEP
: /* 1 */
630 if (!pvParam
) return FALSE
;
632 spi_idx
= SPI_SETBEEP_IDX
;
633 if (!spi_loaded
[spi_idx
])
637 if (SYSPARAMS_Load( SPI_SETBEEP_REGKEY
, SPI_SETBEEP_VALNAME
, buf
, sizeof(buf
) ))
638 beep_active
= !lstrcmpiW( Yes
, buf
);
639 spi_loaded
[spi_idx
] = TRUE
;
642 *(BOOL
*)pvParam
= beep_active
;
645 case SPI_SETBEEP
: /* 2 */
646 spi_idx
= SPI_SETBEEP_IDX
;
647 if (SYSPARAMS_Save( SPI_SETBEEP_REGKEY
, SPI_SETBEEP_VALNAME
,
648 (uiParam
? Yes
: No
), fWinIni
))
650 beep_active
= uiParam
;
651 spi_loaded
[spi_idx
] = TRUE
;
657 case SPI_GETMOUSE
: /* 3 */
658 if (!pvParam
) return FALSE
;
660 spi_idx
= SPI_SETMOUSE_IDX
;
661 if (!spi_loaded
[spi_idx
])
665 if (SYSPARAMS_Load( SPI_SETMOUSE_REGKEY
, SPI_SETMOUSE_VALNAME1
,
667 mouse_threshold1
= atoiW( buf
);
668 if (SYSPARAMS_Load( SPI_SETMOUSE_REGKEY
, SPI_SETMOUSE_VALNAME2
,
670 mouse_threshold2
= atoiW( buf
);
671 if (SYSPARAMS_Load( SPI_SETMOUSE_REGKEY
, SPI_SETMOUSE_VALNAME3
,
673 mouse_speed
= atoiW( buf
);
674 spi_loaded
[spi_idx
] = TRUE
;
676 ((INT
*)pvParam
)[0] = mouse_threshold1
;
677 ((INT
*)pvParam
)[1] = mouse_threshold2
;
678 ((INT
*)pvParam
)[2] = mouse_speed
;
681 case SPI_SETMOUSE
: /* 4 */
685 if (!pvParam
) return FALSE
;
687 spi_idx
= SPI_SETMOUSE_IDX
;
688 wsprintfW(buf
, CSd
, ((INT
*)pvParam
)[0]);
690 if (SYSPARAMS_Save( SPI_SETMOUSE_REGKEY
, SPI_SETMOUSE_VALNAME1
,
693 mouse_threshold1
= ((INT
*)pvParam
)[0];
694 spi_loaded
[spi_idx
] = TRUE
;
696 wsprintfW(buf
, CSd
, ((INT
*)pvParam
)[1]);
697 SYSPARAMS_Save( SPI_SETMOUSE_REGKEY
, SPI_SETMOUSE_VALNAME2
,
699 mouse_threshold2
= ((INT
*)pvParam
)[1];
701 wsprintfW(buf
, CSd
, ((INT
*)pvParam
)[2]);
702 SYSPARAMS_Save( SPI_SETMOUSE_REGKEY
, SPI_SETMOUSE_VALNAME3
,
704 mouse_speed
= ((INT
*)pvParam
)[2];
711 case SPI_GETBORDER
: /* 5 */
712 if (!pvParam
) return FALSE
;
714 spi_idx
= SPI_SETBORDER_IDX
;
715 if (!spi_loaded
[spi_idx
])
719 if (SYSPARAMS_Load( SPI_SETBORDER_REGKEY
, SPI_SETBORDER_VALNAME
, buf
, sizeof(buf
) ))
720 border
= SYSPARAMS_Twips2Pixels( atoiW(buf
) );
722 spi_loaded
[spi_idx
] = TRUE
;
723 SYSMETRICS_Set( SM_CXFRAME
, border
+ GetSystemMetrics( SM_CXDLGFRAME
) );
724 SYSMETRICS_Set( SM_CYFRAME
, border
+ GetSystemMetrics( SM_CXDLGFRAME
) );
726 *(INT
*)pvParam
= border
;
729 case SPI_SETBORDER
: /* 6 */
733 spi_idx
= SPI_SETBORDER_IDX
;
734 wsprintfW(buf
, CSu
, uiParam
);
736 if (SYSPARAMS_Save( SPI_SETBORDER_REGKEY
, SPI_SETBORDER_VALNAME
,
742 spi_loaded
[spi_idx
] = TRUE
;
743 SYSMETRICS_Set( SM_CXFRAME
, uiParam
+ GetSystemMetrics( SM_CXDLGFRAME
) );
744 SYSMETRICS_Set( SM_CYFRAME
, uiParam
+ GetSystemMetrics( SM_CXDLGFRAME
) );
752 case SPI_GETKEYBOARDSPEED
: /* 10 */
753 if (!pvParam
) return FALSE
;
755 spi_idx
= SPI_SETKEYBOARDSPEED_IDX
;
756 if (!spi_loaded
[spi_idx
])
760 if (SYSPARAMS_Load( SPI_SETKEYBOARDSPEED_REGKEY
,
761 SPI_SETKEYBOARDSPEED_VALNAME
,
763 keyboard_speed
= atoiW( buf
);
764 spi_loaded
[spi_idx
] = TRUE
;
766 *(INT
*)pvParam
= keyboard_speed
;
769 case SPI_SETKEYBOARDSPEED
: /* 11 */
773 spi_idx
= SPI_SETKEYBOARDSPEED_IDX
;
776 wsprintfW(buf
, CSu
, uiParam
);
778 if (SYSPARAMS_Save( SPI_SETKEYBOARDSPEED_REGKEY
,
779 SPI_SETKEYBOARDSPEED_VALNAME
,
782 keyboard_speed
= uiParam
;
783 spi_loaded
[spi_idx
] = TRUE
;
790 /* not implemented in Windows */
791 WINE_SPI_WARN(SPI_LANGDRIVER
); /* 12 */
793 case SPI_ICONHORIZONTALSPACING
: /* 13 */
794 spi_idx
= SPI_ICONHORIZONTALSPACING_IDX
;
797 if (!spi_loaded
[spi_idx
])
802 if (SYSPARAMS_Load( SPI_ICONHORIZONTALSPACING_REGKEY
,
803 SPI_ICONHORIZONTALSPACING_VALNAME
, buf
, sizeof(buf
) ))
805 val
= SYSPARAMS_Twips2Pixels( atoiW(buf
) );
806 SYSMETRICS_Set( SM_CXICONSPACING
, val
);
808 spi_loaded
[spi_idx
] = TRUE
;
811 *(INT
*)pvParam
= GetSystemMetrics( SM_CXICONSPACING
);
817 if (uiParam
< 32) uiParam
= 32;
819 wsprintfW(buf
, CSu
, uiParam
);
820 if (SYSPARAMS_Save( SPI_ICONHORIZONTALSPACING_REGKEY
,
821 SPI_ICONHORIZONTALSPACING_VALNAME
,
824 SYSMETRICS_Set( SM_CXICONSPACING
, uiParam
);
825 spi_loaded
[spi_idx
] = TRUE
;
832 case SPI_GETSCREENSAVETIMEOUT
: /* 14 */
833 if (!pvParam
) return FALSE
;
835 spi_idx
= SPI_SETSCREENSAVETIMEOUT_IDX
;
836 if (!spi_loaded
[spi_idx
])
840 if (SYSPARAMS_Load( SPI_SETSCREENSAVETIMEOUT_REGKEY
,
841 SPI_SETSCREENSAVETIMEOUT_VALNAME
,
843 screensave_timeout
= atoiW( buf
);
845 spi_loaded
[spi_idx
] = TRUE
;
847 *(INT
*)pvParam
= screensave_timeout
;
850 case SPI_SETSCREENSAVETIMEOUT
: /* 15 */
854 spi_idx
= SPI_SETSCREENSAVETIMEOUT_IDX
;
855 wsprintfW(buf
, CSu
, uiParam
);
857 if (SYSPARAMS_Save( SPI_SETSCREENSAVETIMEOUT_REGKEY
,
858 SPI_SETSCREENSAVETIMEOUT_VALNAME
,
861 screensave_timeout
= uiParam
;
862 spi_loaded
[spi_idx
] = TRUE
;
869 case SPI_GETSCREENSAVEACTIVE
: /* 16 */
870 if (!pvParam
) return FALSE
;
871 *(BOOL
*)pvParam
= USER_Driver
.pGetScreenSaveActive();
874 case SPI_SETSCREENSAVEACTIVE
: /* 17 */
878 wsprintfW(buf
, CSu
, uiParam
);
879 USER_Driver
.pSetScreenSaveActive( uiParam
);
880 /* saved value does not affect Wine */
881 SYSPARAMS_Save( SPI_SETSCREENSAVEACTIVE_REGKEY
,
882 SPI_SETSCREENSAVEACTIVE_VALNAME
,
887 case SPI_GETGRIDGRANULARITY
: /* 18 */
888 if (!pvParam
) return FALSE
;
890 spi_idx
= SPI_SETGRIDGRANULARITY_IDX
;
891 if (!spi_loaded
[spi_idx
])
895 if (SYSPARAMS_Load( SPI_SETGRIDGRANULARITY_REGKEY
,
896 SPI_SETGRIDGRANULARITY_VALNAME
,
898 grid_granularity
= atoiW( buf
);
900 spi_loaded
[spi_idx
] = TRUE
;
902 *(INT
*)pvParam
= grid_granularity
;
905 case SPI_SETGRIDGRANULARITY
: /* 19 */
909 spi_idx
= SPI_SETGRIDGRANULARITY_IDX
;
910 wsprintfW(buf
, CSu
, uiParam
);
912 if (SYSPARAMS_Save( SPI_SETGRIDGRANULARITY_REGKEY
,
913 SPI_SETGRIDGRANULARITY_VALNAME
,
916 grid_granularity
= uiParam
;
917 spi_loaded
[spi_idx
] = TRUE
;
924 case SPI_SETDESKWALLPAPER
: /* 20 */
925 if (!pvParam
|| !SetDeskWallPaper( (LPSTR
)pvParam
)) return FALSE
;
926 SYSPARAMS_Save(SPI_SETDESKWALLPAPER_REGKEY
, SPI_SETDESKWALLPAPER_VALNAME
, pvParam
, fWinIni
);
929 case SPI_SETDESKPATTERN
: /* 21 */
930 /* FIXME: the ability to specify a pattern in pvParam
931 doesn't seem to be documented for Win32 */
932 if ((INT16
)uiParam
== -1)
935 GetProfileStringW( Desktop
, Pattern
,
937 buf
, sizeof(buf
)/sizeof(WCHAR
) );
938 ret
= DESKTOP_SetPattern( buf
);
940 ret
= DESKTOP_SetPattern( (LPWSTR
)pvParam
);
943 case SPI_GETKEYBOARDDELAY
: /* 22 */
944 if (!pvParam
) return FALSE
;
946 spi_idx
= SPI_SETKEYBOARDDELAY_IDX
;
947 if (!spi_loaded
[spi_idx
])
951 if (SYSPARAMS_Load( SPI_SETKEYBOARDDELAY_REGKEY
,
952 SPI_SETKEYBOARDDELAY_VALNAME
,
955 int i
= atoiW( buf
);
956 if ( (i
>= 0) && (i
<= 3)) keyboard_delay
= i
;
959 spi_loaded
[spi_idx
] = TRUE
;
961 *(INT
*)pvParam
= keyboard_delay
;
964 case SPI_SETKEYBOARDDELAY
: /* 23 */
968 spi_idx
= SPI_SETKEYBOARDDELAY_IDX
;
969 wsprintfW(buf
, CSu
, uiParam
);
971 if (SYSPARAMS_Save( SPI_SETKEYBOARDDELAY_REGKEY
,
972 SPI_SETKEYBOARDDELAY_VALNAME
,
976 keyboard_delay
= uiParam
;
977 spi_loaded
[spi_idx
] = TRUE
;
984 case SPI_ICONVERTICALSPACING
: /* 24 */
985 spi_idx
= SPI_ICONVERTICALSPACING_IDX
;
988 if (!spi_loaded
[spi_idx
])
993 if (SYSPARAMS_Load( SPI_ICONVERTICALSPACING_REGKEY
,
994 SPI_ICONVERTICALSPACING_VALNAME
, buf
, sizeof(buf
) ))
996 val
= SYSPARAMS_Twips2Pixels( atoiW(buf
) );
997 SYSMETRICS_Set( SM_CYICONSPACING
, val
);
999 spi_loaded
[spi_idx
] = TRUE
;
1002 *(INT
*)pvParam
= GetSystemMetrics( SM_CYICONSPACING
);
1008 if (uiParam
< 32) uiParam
= 32;
1010 wsprintfW(buf
, CSu
, uiParam
);
1011 if (SYSPARAMS_Save( SPI_ICONVERTICALSPACING_REGKEY
,
1012 SPI_ICONVERTICALSPACING_VALNAME
,
1015 SYSMETRICS_Set( SM_CYICONSPACING
, uiParam
);
1016 spi_loaded
[spi_idx
] = TRUE
;
1024 case SPI_GETICONTITLEWRAP
: /* 25 */
1025 if (!pvParam
) return FALSE
;
1027 spi_idx
= SPI_SETICONTITLEWRAP_IDX
;
1028 if (!spi_loaded
[spi_idx
])
1032 if (SYSPARAMS_Load( SPI_SETICONTITLEWRAP_REGKEY1
,
1033 SPI_SETICONTITLEWRAP_VALNAME
, buf
, sizeof(buf
) ))
1034 icon_title_wrap
= atoiW(buf
);
1035 spi_loaded
[spi_idx
] = TRUE
;
1038 *(BOOL
*)pvParam
= icon_title_wrap
;
1041 case SPI_SETICONTITLEWRAP
: /* 26 */
1045 spi_idx
= SPI_SETICONTITLEWRAP_IDX
;
1046 wsprintfW(buf
, CSu
, uiParam
);
1047 if (SYSPARAMS_Save( SPI_SETICONTITLEWRAP_REGKEY1
,
1048 SPI_SETICONTITLEWRAP_VALNAME
,
1051 SYSPARAMS_Save( SPI_SETICONTITLEWRAP_REGKEY2
,
1052 SPI_SETICONTITLEWRAP_VALNAME
,
1054 icon_title_wrap
= uiParam
;
1055 spi_loaded
[spi_idx
] = TRUE
;
1062 case SPI_GETMENUDROPALIGNMENT
: /* 27 */
1063 if (!pvParam
) return FALSE
;
1065 spi_idx
= SPI_SETMENUDROPALIGNMENT_IDX
;
1067 if (!spi_loaded
[spi_idx
])
1071 if (SYSPARAMS_Load( SPI_SETMENUDROPALIGNMENT_REGKEY1
,
1072 SPI_SETMENUDROPALIGNMENT_VALNAME
, buf
, sizeof(buf
) ))
1074 SYSMETRICS_Set( SM_MENUDROPALIGNMENT
, atoiW( buf
) );
1076 spi_loaded
[spi_idx
] = TRUE
;
1079 *(BOOL
*)pvParam
= GetSystemMetrics( SM_MENUDROPALIGNMENT
);
1082 case SPI_SETMENUDROPALIGNMENT
: /* 28 */
1085 spi_idx
= SPI_SETMENUDROPALIGNMENT_IDX
;
1087 wsprintfW(buf
, CSu
, uiParam
);
1088 if (SYSPARAMS_Save( SPI_SETMENUDROPALIGNMENT_REGKEY1
,
1089 SPI_SETMENUDROPALIGNMENT_VALNAME
,
1092 SYSPARAMS_Save( SPI_SETMENUDROPALIGNMENT_REGKEY2
,
1093 SPI_SETMENUDROPALIGNMENT_VALNAME
,
1095 SYSMETRICS_Set( SM_MENUDROPALIGNMENT
, uiParam
);
1096 spi_loaded
[spi_idx
] = TRUE
;
1103 case SPI_SETDOUBLECLKWIDTH
: /* 29 */
1106 spi_idx
= SPI_SETDOUBLECLKWIDTH_IDX
;
1108 wsprintfW(buf
, CSu
, uiParam
);
1109 if (SYSPARAMS_Save( SPI_SETDOUBLECLKWIDTH_REGKEY1
,
1110 SPI_SETDOUBLECLKWIDTH_VALNAME
,
1113 SYSPARAMS_Save( SPI_SETDOUBLECLKWIDTH_REGKEY2
,
1114 SPI_SETDOUBLECLKWIDTH_VALNAME
,
1116 SYSMETRICS_Set( SM_CXDOUBLECLK
, uiParam
);
1117 spi_loaded
[spi_idx
] = TRUE
;
1124 case SPI_SETDOUBLECLKHEIGHT
: /* 30 */
1127 spi_idx
= SPI_SETDOUBLECLKHEIGHT_IDX
;
1129 wsprintfW(buf
, CSu
, uiParam
);
1130 if (SYSPARAMS_Save( SPI_SETDOUBLECLKHEIGHT_REGKEY1
,
1131 SPI_SETDOUBLECLKHEIGHT_VALNAME
,
1134 SYSPARAMS_Save( SPI_SETDOUBLECLKHEIGHT_REGKEY2
,
1135 SPI_SETDOUBLECLKHEIGHT_VALNAME
,
1137 SYSMETRICS_Set( SM_CYDOUBLECLK
, uiParam
);
1138 spi_loaded
[spi_idx
] = TRUE
;
1145 case SPI_GETICONTITLELOGFONT
: /* 31 */
1147 LPLOGFONTW lpLogFont
= (LPLOGFONTW
)pvParam
;
1150 if (!pvParam
) return FALSE
;
1153 * The 'default GDI fonts' seems to be returned.
1154 * If a returned font is not a correct font in your environment,
1155 * please try to fix objects/gdiobj.c at first.
1157 SYSPARAMS_GetGUIFont( &lfDefault
);
1159 GetProfileStringW( Desktop
, IconTitleFaceName
,
1160 lfDefault
.lfFaceName
,
1161 lpLogFont
->lfFaceName
, LF_FACESIZE
);
1162 lpLogFont
->lfHeight
= -GetProfileIntW( Desktop
, IconTitleSize
, 11 );
1163 lpLogFont
->lfWidth
= 0;
1164 lpLogFont
->lfEscapement
= lpLogFont
->lfOrientation
= 0;
1165 lpLogFont
->lfWeight
= FW_NORMAL
;
1166 lpLogFont
->lfItalic
= FALSE
;
1167 lpLogFont
->lfStrikeOut
= FALSE
;
1168 lpLogFont
->lfUnderline
= FALSE
;
1169 lpLogFont
->lfCharSet
= lfDefault
.lfCharSet
; /* at least 'charset' should not be hard-coded */
1170 lpLogFont
->lfOutPrecision
= OUT_DEFAULT_PRECIS
;
1171 lpLogFont
->lfClipPrecision
= CLIP_DEFAULT_PRECIS
;
1172 lpLogFont
->lfPitchAndFamily
= DEFAULT_PITCH
;
1173 lpLogFont
->lfQuality
= DEFAULT_QUALITY
;
1177 case SPI_SETDOUBLECLICKTIME
: /* 32 */
1181 spi_idx
= SPI_SETDOUBLECLICKTIME_IDX
;
1182 wsprintfW(buf
, CSu
, uiParam
);
1184 if (SYSPARAMS_Save( SPI_SETDOUBLECLICKTIME_REGKEY
,
1185 SPI_SETDOUBLECLICKTIME_VALNAME
,
1190 double_click_time
= uiParam
;
1191 spi_loaded
[spi_idx
] = TRUE
;
1198 case SPI_SETMOUSEBUTTONSWAP
: /* 33 */
1201 spi_idx
= SPI_SETMOUSEBUTTONSWAP_IDX
;
1203 wsprintfW(buf
, CSu
, uiParam
);
1204 if (SYSPARAMS_Save( SPI_SETMOUSEBUTTONSWAP_REGKEY
,
1205 SPI_SETMOUSEBUTTONSWAP_VALNAME
,
1208 SYSMETRICS_Set( SM_SWAPBUTTON
, uiParam
);
1209 spi_loaded
[spi_idx
] = TRUE
;
1216 WINE_SPI_FIXME(SPI_SETICONTITLELOGFONT
); /* 34 */
1218 case SPI_GETFASTTASKSWITCH
: /* 35 */
1219 if (!pvParam
) return FALSE
;
1220 *(BOOL
*)pvParam
= 1;
1223 case SPI_SETFASTTASKSWITCH
: /* 36 */
1224 /* the action is disabled */
1228 case SPI_SETDRAGFULLWINDOWS
: /* 37 WINVER >= 0x0400 */
1232 spi_idx
= SPI_SETDRAGFULLWINDOWS_IDX
;
1233 wsprintfW(buf
, CSu
, uiParam
);
1234 if (SYSPARAMS_Save( SPI_SETDRAGFULLWINDOWS_REGKEY
,
1235 SPI_SETDRAGFULLWINDOWS_VALNAME
,
1238 drag_full_windows
= uiParam
;
1239 spi_loaded
[spi_idx
] = TRUE
;
1246 case SPI_GETDRAGFULLWINDOWS
: /* 38 WINVER >= 0x0400 */
1247 if (!pvParam
) return FALSE
;
1249 spi_idx
= SPI_SETDRAGFULLWINDOWS_IDX
;
1250 if (!spi_loaded
[spi_idx
])
1254 if (SYSPARAMS_Load( SPI_SETDRAGFULLWINDOWS_REGKEY
,
1255 SPI_SETDRAGFULLWINDOWS_VALNAME
, buf
, sizeof(buf
) ))
1256 drag_full_windows
= atoiW(buf
);
1257 spi_loaded
[spi_idx
] = TRUE
;
1260 *(BOOL
*)pvParam
= drag_full_windows
;
1263 case SPI_GETNONCLIENTMETRICS
: /* 41 WINVER >= 0x400 */
1265 LPNONCLIENTMETRICSW lpnm
= (LPNONCLIENTMETRICSW
)pvParam
;
1267 if (!pvParam
) return FALSE
;
1269 if (lpnm
->cbSize
== sizeof(NONCLIENTMETRICSW
))
1271 /* clear the struct, so we have 'sane' members */
1273 (char *)pvParam
+ sizeof(lpnm
->cbSize
),
1275 lpnm
->cbSize
- sizeof(lpnm
->cbSize
)
1278 /* initialize geometry entries */
1279 lpnm
->iBorderWidth
= 1;
1280 lpnm
->iScrollWidth
= GetSystemMetrics(SM_CXVSCROLL
);
1281 lpnm
->iScrollHeight
= GetSystemMetrics(SM_CYHSCROLL
);
1283 /* size of the normal caption buttons */
1284 lpnm
->iCaptionWidth
= GetSystemMetrics(SM_CXSIZE
);
1285 lpnm
->iCaptionHeight
= GetSystemMetrics(SM_CYSIZE
);
1287 /* caption font metrics */
1288 SystemParametersInfoW( SPI_GETICONTITLELOGFONT
, 0, (LPVOID
)&(lpnm
->lfCaptionFont
), 0 );
1289 lpnm
->lfCaptionFont
.lfWeight
= FW_BOLD
;
1291 /* size of the small caption buttons */
1292 lpnm
->iSmCaptionWidth
= GetSystemMetrics(SM_CXSMSIZE
);
1293 lpnm
->iSmCaptionHeight
= GetSystemMetrics(SM_CYSMSIZE
);
1295 /* small caption font metrics */
1296 SystemParametersInfoW( SPI_GETICONTITLELOGFONT
, 0, (LPVOID
)&(lpnm
->lfSmCaptionFont
), 0 );
1298 /* menus, FIXME: names of wine.conf entries are bogus */
1300 /* size of the menu (MDI) buttons */
1301 lpnm
->iMenuWidth
= GetSystemMetrics(SM_CXMENUSIZE
);
1302 lpnm
->iMenuHeight
= GetSystemMetrics(SM_CYMENUSIZE
);
1304 /* menu font metrics */
1305 SystemParametersInfoW( SPI_GETICONTITLELOGFONT
, 0, (LPVOID
)&(lpnm
->lfMenuFont
), 0 );
1306 GetProfileStringW( Desktop
, MenuFont
, lpnm
->lfCaptionFont
.lfFaceName
,
1307 lpnm
->lfMenuFont
.lfFaceName
, LF_FACESIZE
);
1308 lpnm
->lfMenuFont
.lfHeight
= -GetProfileIntW( Desktop
, MenuFontSize
, 11 );
1309 lpnm
->lfMenuFont
.lfWeight
= FW_NORMAL
;
1311 /* status bar font metrics */
1312 SystemParametersInfoW( SPI_GETICONTITLELOGFONT
, 0,
1313 (LPVOID
)&(lpnm
->lfStatusFont
), 0 );
1314 /* message font metrics */
1315 SystemParametersInfoW( SPI_GETICONTITLELOGFONT
, 0,
1316 (LPVOID
)&(lpnm
->lfMessageFont
), 0 );
1320 WARN("size mismatch !! (is %d; should be %d)\n", lpnm
->cbSize
, sizeof(NONCLIENTMETRICSW
));
1321 /* FIXME: SetLastError? */
1326 WINE_SPI_FIXME(SPI_SETNONCLIENTMETRICS
); /* 42 WINVER >= 0x400 */
1328 case SPI_GETMINIMIZEDMETRICS
: /* 43 WINVER >= 0x400 */
1330 MINIMIZEDMETRICS
* lpMm
= pvParam
;
1331 if (lpMm
&& lpMm
->cbSize
== sizeof(*lpMm
))
1333 /* these taken from Win2k SP3 */
1343 WINE_SPI_FIXME(SPI_SETMINIMIZEDMETRICS
); /* 44 WINVER >= 0x400 */
1345 case SPI_GETICONMETRICS
: /* 45 WINVER >= 0x400 */
1347 LPICONMETRICSW lpIcon
= pvParam
;
1348 if(lpIcon
&& lpIcon
->cbSize
== sizeof(*lpIcon
))
1350 SystemParametersInfoW( SPI_ICONHORIZONTALSPACING
, 0,
1351 &lpIcon
->iHorzSpacing
, FALSE
);
1352 SystemParametersInfoW( SPI_ICONVERTICALSPACING
, 0,
1353 &lpIcon
->iVertSpacing
, FALSE
);
1354 SystemParametersInfoW( SPI_GETICONTITLEWRAP
, 0,
1355 &lpIcon
->iTitleWrap
, FALSE
);
1356 SystemParametersInfoW( SPI_GETICONTITLELOGFONT
, 0,
1357 &lpIcon
->lfFont
, FALSE
);
1365 WINE_SPI_FIXME(SPI_SETICONMETRICS
); /* 46 WINVER >= 0x400 */
1367 case SPI_SETWORKAREA
: /* 47 WINVER >= 0x400 */
1369 static const WCHAR CSld
[]={'%','l','d',' ','%','l','d',' ','%','l','d',' ','%','l','d',0};
1371 RECT
*pr
= (RECT
*) pvParam
;
1373 if (!pvParam
) return FALSE
;
1375 spi_idx
= SPI_SETWORKAREA_IDX
;
1376 wsprintfW(buf
, CSld
, pr
->left
, pr
->top
,
1377 pr
->right
, pr
->bottom
);
1379 if (SYSPARAMS_Save( SPI_SETWORKAREA_REGKEY
,
1380 SPI_SETWORKAREA_VALNAME
,
1383 CopyRect( &work_area
, (RECT
*)pvParam
);
1384 spi_loaded
[spi_idx
] = TRUE
;
1391 case SPI_GETWORKAREA
: /* 48 WINVER >= 0x400 */
1392 if (!pvParam
) return FALSE
;
1394 spi_idx
= SPI_SETWORKAREA_IDX
;
1395 if (!spi_loaded
[spi_idx
])
1399 SetRect( &work_area
, 0, 0,
1400 GetSystemMetrics( SM_CXSCREEN
),
1401 GetSystemMetrics( SM_CYSCREEN
) );
1403 if (SYSPARAMS_Load( SPI_SETWORKAREA_REGKEY
,
1404 SPI_SETWORKAREA_VALNAME
,
1408 WideCharToMultiByte( CP_ACP
, 0, buf
, -1,
1409 tmpbuf
, sizeof(tmpbuf
), NULL
, NULL
);
1410 sscanf( tmpbuf
, "%ld %ld %ld %ld",
1411 &work_area
.left
, &work_area
.top
,
1412 &work_area
.right
, &work_area
.bottom
);
1414 spi_loaded
[spi_idx
] = TRUE
;
1416 CopyRect( (RECT
*)pvParam
, &work_area
);
1420 WINE_SPI_FIXME(SPI_SETPENWINDOWS
); /* 49 WINVER >= 0x400 */
1422 case SPI_GETFILTERKEYS
: /* 50 */
1424 LPFILTERKEYS lpFilterKeys
= (LPFILTERKEYS
)pvParam
;
1425 WARN("SPI_GETFILTERKEYS not fully implemented\n");
1426 if (lpFilterKeys
&& lpFilterKeys
->cbSize
== sizeof(FILTERKEYS
))
1428 /* Indicate that no FilterKeys feature available */
1429 lpFilterKeys
->dwFlags
= 0;
1430 lpFilterKeys
->iWaitMSec
= 0;
1431 lpFilterKeys
->iDelayMSec
= 0;
1432 lpFilterKeys
->iRepeatMSec
= 0;
1433 lpFilterKeys
->iBounceMSec
= 0;
1441 WINE_SPI_FIXME(SPI_SETFILTERKEYS
); /* 51 */
1443 case SPI_GETTOGGLEKEYS
: /* 52 */
1445 LPTOGGLEKEYS lpToggleKeys
= (LPTOGGLEKEYS
)pvParam
;
1446 WARN("SPI_GETTOGGLEKEYS not fully implemented\n");
1447 if (lpToggleKeys
&& lpToggleKeys
->cbSize
== sizeof(TOGGLEKEYS
))
1449 /* Indicate that no ToggleKeys feature available */
1450 lpToggleKeys
->dwFlags
= 0;
1458 WINE_SPI_FIXME(SPI_SETTOGGLEKEYS
); /* 53 */
1460 case SPI_GETMOUSEKEYS
: /* 54 */
1462 LPMOUSEKEYS lpMouseKeys
= (LPMOUSEKEYS
)pvParam
;
1463 WARN("SPI_GETMOUSEKEYS not fully implemented\n");
1464 if (lpMouseKeys
&& lpMouseKeys
->cbSize
== sizeof(MOUSEKEYS
))
1466 /* Indicate that no MouseKeys feature available */
1467 lpMouseKeys
->dwFlags
= 0;
1468 lpMouseKeys
->iMaxSpeed
= 360;
1469 lpMouseKeys
->iTimeToMaxSpeed
= 1000;
1470 lpMouseKeys
->iCtrlSpeed
= 0;
1471 lpMouseKeys
->dwReserved1
= 0;
1472 lpMouseKeys
->dwReserved2
= 0;
1480 WINE_SPI_FIXME(SPI_SETMOUSEKEYS
); /* 55 */
1482 case SPI_GETSHOWSOUNDS
: /* 56 */
1483 if (!pvParam
) return FALSE
;
1485 spi_idx
= SPI_SETSHOWSOUNDS_IDX
;
1487 if (!spi_loaded
[spi_idx
])
1491 if (SYSPARAMS_Load( SPI_SETSHOWSOUNDS_REGKEY
,
1492 SPI_SETSHOWSOUNDS_VALNAME
, buf
, sizeof(buf
) ))
1494 SYSMETRICS_Set( SM_SHOWSOUNDS
, atoiW( buf
) );
1496 spi_loaded
[spi_idx
] = TRUE
;
1499 *(INT
*)pvParam
= GetSystemMetrics( SM_SHOWSOUNDS
);
1502 case SPI_SETSHOWSOUNDS
: /* 57 */
1505 spi_idx
= SPI_SETSHOWSOUNDS_IDX
;
1507 wsprintfW(buf
, CSu
, uiParam
);
1508 if (SYSPARAMS_Save( SPI_SETSHOWSOUNDS_REGKEY
,
1509 SPI_SETSHOWSOUNDS_VALNAME
,
1512 SYSMETRICS_Set( SM_SHOWSOUNDS
, uiParam
);
1513 spi_loaded
[spi_idx
] = TRUE
;
1520 case SPI_GETSTICKYKEYS
: /* 58 */
1522 LPSTICKYKEYS lpStickyKeys
= (LPSTICKYKEYS
)pvParam
;
1523 WARN("SPI_GETSTICKYKEYS not fully implemented\n");
1524 if (lpStickyKeys
&& lpStickyKeys
->cbSize
== sizeof(STICKYKEYS
))
1526 /* Indicate that no StickyKeys feature available */
1527 lpStickyKeys
->dwFlags
= 0;
1535 WINE_SPI_FIXME(SPI_SETSTICKYKEYS
); /* 59 */
1537 case SPI_GETACCESSTIMEOUT
: /* 60 */
1539 LPACCESSTIMEOUT lpAccessTimeout
= (LPACCESSTIMEOUT
)pvParam
;
1540 WARN("SPI_GETACCESSTIMEOUT not fully implemented\n");
1541 if (lpAccessTimeout
&& lpAccessTimeout
->cbSize
== sizeof(ACCESSTIMEOUT
))
1543 /* Indicate that no accessibility features timeout is available */
1544 lpAccessTimeout
->dwFlags
= 0;
1545 lpAccessTimeout
->iTimeOutMSec
= 0;
1553 WINE_SPI_FIXME(SPI_SETACCESSTIMEOUT
); /* 61 */
1555 case SPI_GETSERIALKEYS
: /* 62 WINVER >= 0x400 */
1557 LPSERIALKEYSW lpSerialKeysW
= (LPSERIALKEYSW
)pvParam
;
1558 WARN("SPI_GETSERIALKEYS not fully implemented\n");
1559 if (lpSerialKeysW
&& lpSerialKeysW
->cbSize
== sizeof(SERIALKEYSW
))
1561 /* Indicate that no SerialKeys feature available */
1562 lpSerialKeysW
->dwFlags
= 0;
1563 lpSerialKeysW
->lpszActivePort
= NULL
;
1564 lpSerialKeysW
->lpszPort
= NULL
;
1565 lpSerialKeysW
->iBaudRate
= 0;
1566 lpSerialKeysW
->iPortState
= 0;
1574 WINE_SPI_FIXME(SPI_SETSERIALKEYS
); /* 63 WINVER >= 0x400 */
1576 case SPI_GETSOUNDSENTRY
: /* 64 */
1578 LPSOUNDSENTRYW lpSoundSentryW
= (LPSOUNDSENTRYW
)pvParam
;
1579 WARN("SPI_GETSOUNDSENTRY not fully implemented\n");
1580 if (lpSoundSentryW
&& lpSoundSentryW
->cbSize
== sizeof(SOUNDSENTRYW
))
1582 /* Indicate that no SoundSentry feature available */
1583 lpSoundSentryW
->dwFlags
= 0;
1584 lpSoundSentryW
->iFSTextEffect
= 0;
1585 lpSoundSentryW
->iFSTextEffectMSec
= 0;
1586 lpSoundSentryW
->iFSTextEffectColorBits
= 0;
1587 lpSoundSentryW
->iFSGrafEffect
= 0;
1588 lpSoundSentryW
->iFSGrafEffectMSec
= 0;
1589 lpSoundSentryW
->iFSGrafEffectColor
= 0;
1590 lpSoundSentryW
->iWindowsEffect
= 0;
1591 lpSoundSentryW
->iWindowsEffectMSec
= 0;
1592 lpSoundSentryW
->lpszWindowsEffectDLL
= 0;
1593 lpSoundSentryW
->iWindowsEffectOrdinal
= 0;
1601 WINE_SPI_FIXME(SPI_SETSOUNDSENTRY
); /* 65 */
1603 case SPI_GETHIGHCONTRAST
: /* 66 WINVER >= 0x400 */
1605 LPHIGHCONTRASTW lpHighContrastW
= (LPHIGHCONTRASTW
)pvParam
;
1606 WARN("SPI_GETHIGHCONTRAST not fully implemented\n");
1607 if (lpHighContrastW
&& lpHighContrastW
->cbSize
== sizeof(HIGHCONTRASTW
))
1609 /* Indicate that no high contrast feature available */
1610 lpHighContrastW
->dwFlags
= 0;
1611 lpHighContrastW
->lpszDefaultScheme
= NULL
;
1619 WINE_SPI_FIXME(SPI_SETHIGHCONTRAST
); /* 67 WINVER >= 0x400 */
1621 case SPI_GETKEYBOARDPREF
: /* 68 WINVER >= 0x400 */
1622 if (!pvParam
) return FALSE
;
1624 spi_idx
= SPI_SETKEYBOARDPREF_IDX
;
1625 if (!spi_loaded
[spi_idx
])
1629 if (SYSPARAMS_Load( SPI_SETKEYBOARDPREF_REGKEY
,
1630 SPI_SETKEYBOARDPREF_VALNAME
, buf
, sizeof(buf
) ))
1631 keyboard_pref
= atoiW(buf
);
1632 spi_loaded
[spi_idx
] = TRUE
;
1635 *(BOOL
*)pvParam
= keyboard_pref
;
1638 case SPI_SETKEYBOARDPREF
: /* 69 WINVER >= 0x400 */
1642 spi_idx
= SPI_SETKEYBOARDPREF_IDX
;
1643 wsprintfW(buf
, CSu
, uiParam
);
1644 if (SYSPARAMS_Save( SPI_SETKEYBOARDPREF_REGKEY
,
1645 SPI_SETKEYBOARDPREF_VALNAME
,
1648 keyboard_pref
= uiParam
;
1649 spi_loaded
[spi_idx
] = TRUE
;
1656 case SPI_GETSCREENREADER
: /* 70 WINVER >= 0x400 */
1657 if (!pvParam
) return FALSE
;
1659 spi_idx
= SPI_SETSCREENREADER_IDX
;
1660 if (!spi_loaded
[spi_idx
])
1664 if (SYSPARAMS_Load( SPI_SETSCREENREADER_REGKEY
,
1665 SPI_SETSCREENREADER_VALNAME
, buf
, sizeof(buf
) ))
1666 screen_reader
= atoiW(buf
);
1667 spi_loaded
[spi_idx
] = TRUE
;
1670 *(BOOL
*)pvParam
= screen_reader
;
1673 case SPI_SETSCREENREADER
: /* 71 WINVER >= 0x400 */
1677 spi_idx
= SPI_SETSCREENREADER_IDX
;
1678 wsprintfW(buf
, CSu
, uiParam
);
1679 if (SYSPARAMS_Save( SPI_SETSCREENREADER_REGKEY
,
1680 SPI_SETSCREENREADER_VALNAME
,
1683 screen_reader
= uiParam
;
1684 spi_loaded
[spi_idx
] = TRUE
;
1691 case SPI_GETANIMATION
: /* 72 WINVER >= 0x400 */
1693 LPANIMATIONINFO lpAnimInfo
= (LPANIMATIONINFO
)pvParam
;
1695 /* Tell it "disabled" */
1696 if (lpAnimInfo
&& lpAnimInfo
->cbSize
== sizeof(ANIMATIONINFO
))
1697 lpAnimInfo
->iMinAnimate
= 0; /* Minimise and restore animation is disabled (nonzero == enabled) */
1702 WINE_SPI_WARN(SPI_SETANIMATION
); /* 73 WINVER >= 0x400 */
1704 case SPI_GETFONTSMOOTHING
: /* 74 WINVER >= 0x400 */
1705 if (!pvParam
) return FALSE
;
1707 spi_idx
= SPI_SETFONTSMOOTHING_IDX
;
1708 if (!spi_loaded
[spi_idx
])
1712 if (SYSPARAMS_Load( SPI_SETFONTSMOOTHING_REGKEY
,
1713 SPI_SETFONTSMOOTHING_VALNAME
, buf
, sizeof(buf
) ))
1715 spi_loaded
[spi_idx
] = TRUE
;
1716 if (buf
[0] == 0x01 || buf
[0] == 0x02) /* 0x01 for 95/98/NT, 0x02 for 98/ME/2k/XP */
1718 font_smoothing
= TRUE
;
1723 *(BOOL
*)pvParam
= font_smoothing
;
1727 WINE_SPI_FIXME(SPI_SETFONTSMOOTHING
); /* 75 WINVER >= 0x400 */
1729 WINE_SPI_FIXME(SPI_SETDRAGWIDTH
); /* 76 WINVER >= 0x400 */
1730 WINE_SPI_FIXME(SPI_SETDRAGHEIGHT
); /* 77 WINVER >= 0x400 */
1732 WINE_SPI_FIXME(SPI_SETHANDHELD
); /* 78 WINVER >= 0x400 */
1734 WINE_SPI_FIXME(SPI_GETLOWPOWERTIMEOUT
); /* 79 WINVER >= 0x400 */
1735 WINE_SPI_FIXME(SPI_GETPOWEROFFTIMEOUT
); /* 80 WINVER >= 0x400 */
1736 WINE_SPI_FIXME(SPI_SETLOWPOWERTIMEOUT
); /* 81 WINVER >= 0x400 */
1737 WINE_SPI_FIXME(SPI_SETPOWEROFFTIMEOUT
); /* 82 WINVER >= 0x400 */
1738 WINE_SPI_FIXME(SPI_GETLOWPOWERACTIVE
); /* 83 WINVER >= 0x400 */
1739 WINE_SPI_FIXME(SPI_GETPOWEROFFACTIVE
); /* 84 WINVER >= 0x400 */
1740 WINE_SPI_FIXME(SPI_SETLOWPOWERACTIVE
); /* 85 WINVER >= 0x400 */
1741 WINE_SPI_FIXME(SPI_SETPOWEROFFACTIVE
); /* 86 WINVER >= 0x400 */
1743 WINE_SPI_FIXME(SPI_SETCURSORS
); /* 87 WINVER >= 0x400 */
1744 WINE_SPI_FIXME(SPI_SETICONS
); /* 88 WINVER >= 0x400 */
1746 case SPI_GETDEFAULTINPUTLANG
: /* 89 WINVER >= 0x400 */
1747 ret
= GetKeyboardLayout(0) ? TRUE
: FALSE
;
1750 WINE_SPI_FIXME(SPI_SETDEFAULTINPUTLANG
); /* 90 WINVER >= 0x400 */
1752 WINE_SPI_FIXME(SPI_SETLANGTOGGLE
); /* 91 WINVER >= 0x400 */
1754 case SPI_GETWINDOWSEXTENSION
: /* 92 WINVER >= 0x400 */
1755 WARN("pretend no support for Win9x Plus! for now.\n");
1756 ret
= FALSE
; /* yes, this is the result value */
1759 WINE_SPI_FIXME(SPI_SETMOUSETRAILS
); /* 93 WINVER >= 0x400 */
1760 WINE_SPI_FIXME(SPI_GETMOUSETRAILS
); /* 94 WINVER >= 0x400 */
1762 case SPI_SETSCREENSAVERRUNNING
: /* 97 WINVER >= 0x400 */
1764 /* SPI_SCREENSAVERRUNNING is an alias for SPI_SETSCREENSAVERRUNNING */
1767 spi_idx
= SPI_SETSCREENSAVERRUNNING_IDX
;
1768 wsprintfW(buf
, CSu
, uiParam
);
1770 /* save only temporarily */
1771 if (SYSPARAMS_Save( SPI_SETSCREENSAVERRUNNING_REGKEY
,
1772 SPI_SETSCREENSAVERRUNNING_VALNAME
,
1775 screensaver_running
= uiParam
;
1776 spi_loaded
[spi_idx
] = TRUE
;
1783 case SPI_GETMOUSEHOVERWIDTH
: /* 98 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1784 if (!pvParam
) return FALSE
;
1786 spi_idx
= SPI_SETMOUSEHOVERWIDTH_IDX
;
1787 if (!spi_loaded
[spi_idx
])
1791 if (SYSPARAMS_Load( SPI_SETMOUSEHOVERWIDTH_REGKEY
,
1792 SPI_SETMOUSEHOVERWIDTH_VALNAME
,
1794 mouse_hover_width
= atoiW( buf
);
1795 spi_loaded
[spi_idx
] = TRUE
;
1797 *(INT
*)pvParam
= mouse_hover_width
;
1800 case SPI_SETMOUSEHOVERWIDTH
: /* 99 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1804 spi_idx
= SPI_SETMOUSEHOVERWIDTH_IDX
;
1805 wsprintfW(buf
, CSu
, uiParam
);
1807 if (SYSPARAMS_Save( SPI_SETMOUSEHOVERWIDTH_REGKEY
,
1808 SPI_SETMOUSEHOVERWIDTH_VALNAME
,
1811 mouse_hover_width
= uiParam
;
1812 spi_loaded
[spi_idx
] = TRUE
;
1819 case SPI_GETMOUSEHOVERHEIGHT
: /* 100 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1820 if (!pvParam
) return FALSE
;
1822 spi_idx
= SPI_SETMOUSEHOVERHEIGHT_IDX
;
1823 if (!spi_loaded
[spi_idx
])
1827 if (SYSPARAMS_Load( SPI_SETMOUSEHOVERHEIGHT_REGKEY
,
1828 SPI_SETMOUSEHOVERHEIGHT_VALNAME
,
1830 mouse_hover_height
= atoiW( buf
);
1832 spi_loaded
[spi_idx
] = TRUE
;
1834 *(INT
*)pvParam
= mouse_hover_height
;
1837 case SPI_SETMOUSEHOVERHEIGHT
: /* 101 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1841 spi_idx
= SPI_SETMOUSEHOVERHEIGHT_IDX
;
1842 wsprintfW(buf
, CSu
, uiParam
);
1844 if (SYSPARAMS_Save( SPI_SETMOUSEHOVERHEIGHT_REGKEY
,
1845 SPI_SETMOUSEHOVERHEIGHT_VALNAME
,
1848 mouse_hover_height
= uiParam
;
1849 spi_loaded
[spi_idx
] = TRUE
;
1856 case SPI_GETMOUSEHOVERTIME
: /* 102 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1857 if (!pvParam
) return FALSE
;
1859 spi_idx
= SPI_SETMOUSEHOVERTIME_IDX
;
1860 if (!spi_loaded
[spi_idx
])
1864 if (SYSPARAMS_Load( SPI_SETMOUSEHOVERTIME_REGKEY
,
1865 SPI_SETMOUSEHOVERTIME_VALNAME
,
1867 mouse_hover_time
= atoiW( buf
);
1869 spi_loaded
[spi_idx
] = TRUE
;
1871 *(INT
*)pvParam
= mouse_hover_time
;
1874 case SPI_SETMOUSEHOVERTIME
: /* 103 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1878 spi_idx
= SPI_SETMOUSEHOVERTIME_IDX
;
1879 wsprintfW(buf
, CSu
, uiParam
);
1881 if (SYSPARAMS_Save( SPI_SETMOUSEHOVERTIME_REGKEY
,
1882 SPI_SETMOUSEHOVERTIME_VALNAME
,
1885 mouse_hover_time
= uiParam
;
1886 spi_loaded
[spi_idx
] = TRUE
;
1893 case SPI_GETWHEELSCROLLLINES
: /* 104 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1894 if (!pvParam
) return FALSE
;
1896 spi_idx
= SPI_SETMOUSESCROLLLINES_IDX
;
1897 if (!spi_loaded
[spi_idx
])
1901 if (SYSPARAMS_Load( SPI_SETMOUSESCROLLLINES_REGKEY
,
1902 SPI_SETMOUSESCROLLLINES_VALNAME
,
1904 mouse_scroll_lines
= atoiW( buf
);
1906 spi_loaded
[spi_idx
] = TRUE
;
1908 *(INT
*)pvParam
= mouse_scroll_lines
;
1911 case SPI_SETWHEELSCROLLLINES
: /* 105 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1915 spi_idx
= SPI_SETMOUSESCROLLLINES_IDX
;
1916 wsprintfW(buf
, CSu
, uiParam
);
1918 if (SYSPARAMS_Save( SPI_SETMOUSESCROLLLINES_REGKEY
,
1919 SPI_SETMOUSESCROLLLINES_VALNAME
,
1922 mouse_scroll_lines
= uiParam
;
1923 spi_loaded
[spi_idx
] = TRUE
;
1930 case SPI_GETMENUSHOWDELAY
: /* 106 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1931 if (!pvParam
) return FALSE
;
1933 spi_idx
= SPI_SETMENUSHOWDELAY_IDX
;
1934 if (!spi_loaded
[spi_idx
])
1938 if (SYSPARAMS_Load( SPI_SETMENUSHOWDELAY_REGKEY
,
1939 SPI_SETMENUSHOWDELAY_VALNAME
,
1941 menu_show_delay
= atoiW( buf
);
1943 spi_loaded
[spi_idx
] = TRUE
;
1945 *(INT
*)pvParam
= menu_show_delay
;
1948 case SPI_SETMENUSHOWDELAY
: /* 107 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1952 spi_idx
= SPI_SETMENUSHOWDELAY_IDX
;
1953 wsprintfW(buf
, CSu
, uiParam
);
1955 if (SYSPARAMS_Save( SPI_SETMENUSHOWDELAY_REGKEY
,
1956 SPI_SETMENUSHOWDELAY_VALNAME
,
1959 menu_show_delay
= uiParam
;
1960 spi_loaded
[spi_idx
] = TRUE
;
1967 WINE_SPI_FIXME(SPI_GETSHOWIMEUI
); /* 110 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1968 WINE_SPI_FIXME(SPI_SETSHOWIMEUI
); /* 111 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
1969 WINE_SPI_FIXME(SPI_GETMOUSESPEED
); /* 112 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1970 WINE_SPI_FIXME(SPI_SETMOUSESPEED
); /* 113 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1972 case SPI_GETSCREENSAVERRUNNING
: /* 114 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1973 if (!pvParam
) return FALSE
;
1975 spi_idx
= SPI_SETSCREENSAVERRUNNING_IDX
;
1976 if (!spi_loaded
[spi_idx
])
1980 if (SYSPARAMS_Load( SPI_SETSCREENSAVERRUNNING_REGKEY
,
1981 SPI_SETSCREENSAVERRUNNING_VALNAME
, buf
, sizeof(buf
) ))
1982 screensaver_running
= atoiW( buf
);
1983 spi_loaded
[spi_idx
] = TRUE
;
1986 *(BOOL
*)pvParam
= screensaver_running
;
1989 case SPI_GETDESKWALLPAPER
: /* 115 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
1991 WCHAR buf
[MAX_PATH
];
1993 if (!pvParam
) return FALSE
;
1995 if (uiParam
> MAX_PATH
)
2000 if (SYSPARAMS_Load(SPI_SETDESKWALLPAPER_REGKEY
, SPI_SETDESKWALLPAPER_VALNAME
, buf
, sizeof(buf
)))
2002 lstrcpynW((WCHAR
*)pvParam
, buf
, uiParam
);
2006 /* Return an empty string */
2007 memset((WCHAR
*)pvParam
, 0, uiParam
);
2013 WINE_SPI_FIXME(SPI_GETACTIVEWINDOWTRACKING
);/* 0x1000 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2014 WINE_SPI_FIXME(SPI_SETACTIVEWINDOWTRACKING
);/* 0x1001 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2015 WINE_SPI_FIXME(SPI_GETMENUANIMATION
); /* 0x1002 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2016 WINE_SPI_FIXME(SPI_SETMENUANIMATION
); /* 0x1003 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2017 WINE_SPI_FIXME(SPI_GETCOMBOBOXANIMATION
); /* 0x1004 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2018 WINE_SPI_FIXME(SPI_SETCOMBOBOXANIMATION
); /* 0x1005 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2020 case SPI_GETLISTBOXSMOOTHSCROLLING
: /* 0x1006 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2021 if (!pvParam
) return FALSE
;
2023 spi_idx
= SPI_SETLISTBOXSMOOTHSCROLLING_IDX
;
2024 if (!spi_loaded
[spi_idx
])
2028 if (SYSPARAMS_Load( SPI_SETLISTBOXSMOOTHSCROLLING_REGKEY
,
2029 SPI_SETLISTBOXSMOOTHSCROLLING_VALNAME
, buf
, sizeof(buf
) ))
2031 if ((buf
[0]&0x01) == 0x01)
2033 listbox_smoothscrolling
= TRUE
;
2036 spi_loaded
[spi_idx
] = TRUE
;
2039 *(BOOL
*)pvParam
= listbox_smoothscrolling
;
2043 WINE_SPI_FIXME(SPI_SETLISTBOXSMOOTHSCROLLING
);/* 0x1007 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2045 case SPI_GETGRADIENTCAPTIONS
: /* 0x1008 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2046 if (!pvParam
) return FALSE
;
2048 spi_idx
= SPI_SETGRADIENTCAPTIONS_IDX
;
2049 if (!spi_loaded
[spi_idx
])
2053 if (SYSPARAMS_Load( SPI_USERPREFERENCEMASK_REGKEY
,
2054 SPI_USERPREFERENCEMASK_VALNAME
, buf
, sizeof(buf
) ))
2056 if ((buf
[0]&0x10) == 0x10)
2058 gradient_captions
= TRUE
;
2061 spi_loaded
[spi_idx
] = TRUE
;
2064 *(BOOL
*)pvParam
= gradient_captions
;
2068 WINE_SPI_FIXME(SPI_SETGRADIENTCAPTIONS
); /* 0x1009 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2070 case SPI_GETKEYBOARDCUES
: /* 0x100A _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2071 if (!pvParam
) return FALSE
;
2073 spi_idx
= SPI_SETKEYBOARDCUES_IDX
;
2074 if (!spi_loaded
[spi_idx
])
2078 if (SYSPARAMS_Load( SPI_USERPREFERENCEMASK_REGKEY
,
2079 SPI_USERPREFERENCEMASK_VALNAME
, buf
, sizeof(buf
) ))
2081 if ((buf
[0]&0x20) == 0x20)
2083 keyboard_cues
= TRUE
;
2086 spi_loaded
[spi_idx
] = TRUE
;
2089 *(BOOL
*)pvParam
= keyboard_cues
;
2093 WINE_SPI_FIXME(SPI_SETKEYBOARDCUES
); /* 0x100B _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2094 WINE_SPI_FIXME(SPI_GETACTIVEWNDTRKZORDER
); /* 0x100C _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2095 WINE_SPI_FIXME(SPI_SETACTIVEWNDTRKZORDER
); /* 0x100D _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2096 case SPI_GETHOTTRACKING
: /* 0x100E _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2097 if (!pvParam
) return FALSE
;
2099 spi_idx
= SPI_SETHOTTRACKING_IDX
;
2100 if (!spi_loaded
[spi_idx
])
2104 if (SYSPARAMS_Load( SPI_USERPREFERENCEMASK_REGKEY
,
2105 SPI_USERPREFERENCEMASK_VALNAME
, buf
, sizeof(buf
) ))
2107 if ((buf
[0]&0x80) == 0x80)
2109 hot_tracking
= TRUE
;
2112 spi_loaded
[spi_idx
] = TRUE
;
2115 *(BOOL
*)pvParam
= hot_tracking
;
2119 WINE_SPI_FIXME(SPI_SETHOTTRACKING
); /* 0x100F _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2120 WINE_SPI_FIXME(SPI_GETSELECTIONFADE
); /* 0x1014 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2121 WINE_SPI_FIXME(SPI_SETSELECTIONFADE
); /* 0x1015 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2122 WINE_SPI_FIXME(SPI_GETDROPSHADOW
); /* 0x1024 _WIN32_WINNT >= 0x510 */
2123 WINE_SPI_FIXME(SPI_SETDROPSHADOW
); /* 0x1025 _WIN32_WINNT >= 0x510 */
2124 WINE_SPI_FIXME(SPI_GETFOREGROUNDLOCKTIMEOUT
);/* 0x2000 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2125 WINE_SPI_FIXME(SPI_SETFOREGROUNDLOCKTIMEOUT
);/* 0x2001 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2126 WINE_SPI_FIXME(SPI_GETACTIVEWNDTRKTIMEOUT
); /* 0x2002 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2127 WINE_SPI_FIXME(SPI_SETACTIVEWNDTRKTIMEOUT
); /* 0x2003 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2128 WINE_SPI_FIXME(SPI_GETFOREGROUNDFLASHCOUNT
);/* 0x2004 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2129 WINE_SPI_FIXME(SPI_SETFOREGROUNDFLASHCOUNT
);/* 0x2005 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2132 FIXME( "Unknown action: %u\n", uiAction
);
2133 SetLastError( ERROR_INVALID_SPI_VALUE
);
2139 SYSPARAMS_NotifyChange( uiAction
, fWinIni
);
2142 #undef WINE_SPI_FIXME
2143 #undef WINE_SPI_WARN
2147 /***********************************************************************
2148 * SystemParametersInfo (USER.483)
2150 BOOL16 WINAPI
SystemParametersInfo16( UINT16 uAction
, UINT16 uParam
,
2151 LPVOID lpvParam
, UINT16 fuWinIni
)
2155 TRACE("(%u, %u, %p, %u)\n", uAction
, uParam
, lpvParam
, fuWinIni
);
2159 case SPI_GETBEEP
: /* 1 */
2160 case SPI_GETSCREENSAVEACTIVE
: /* 16 */
2161 case SPI_GETICONTITLEWRAP
: /* 25 */
2162 case SPI_GETMENUDROPALIGNMENT
: /* 27 */
2163 case SPI_GETFASTTASKSWITCH
: /* 35 */
2164 case SPI_GETDRAGFULLWINDOWS
: /* 38 WINVER >= 0x0400 */
2167 ret
= SystemParametersInfoA( uAction
, uParam
, lpvParam
? &tmp
: NULL
, fuWinIni
);
2168 if (ret
&& lpvParam
)
2169 *(BOOL16
*)lpvParam
= tmp
;
2173 case SPI_GETBORDER
: /* 5 */
2174 case SPI_ICONHORIZONTALSPACING
: /* 13 */
2175 case SPI_GETSCREENSAVETIMEOUT
: /* 14 */
2176 case SPI_GETGRIDGRANULARITY
: /* 18 */
2177 case SPI_GETKEYBOARDDELAY
: /* 22 */
2178 case SPI_ICONVERTICALSPACING
: /* 24 */
2181 ret
= SystemParametersInfoA( uAction
, uParam
, lpvParam
? &tmp
: NULL
, fuWinIni
);
2182 if (ret
&& lpvParam
)
2183 *(INT16
*)lpvParam
= tmp
;
2187 case SPI_GETKEYBOARDSPEED
: /* 10 */
2190 ret
= SystemParametersInfoA( uAction
, uParam
, lpvParam
? &tmp
: NULL
, fuWinIni
);
2191 if (ret
&& lpvParam
)
2192 *(WORD
*)lpvParam
= tmp
;
2196 case SPI_GETICONTITLELOGFONT
: /* 31 */
2199 ret
= SystemParametersInfoA( uAction
, uParam
, lpvParam
? &tmp
: NULL
, fuWinIni
);
2200 if (ret
&& lpvParam
)
2201 SYSPARAMS_LogFont32ATo16( &tmp
, (LPLOGFONT16
)lpvParam
);
2205 case SPI_GETNONCLIENTMETRICS
: /* 41 WINVER >= 0x400 */
2207 NONCLIENTMETRICSA tmp
;
2208 LPNONCLIENTMETRICS16 lpnm16
= (LPNONCLIENTMETRICS16
)lpvParam
;
2209 if (lpnm16
&& lpnm16
->cbSize
== sizeof(NONCLIENTMETRICS16
))
2211 tmp
.cbSize
= sizeof(NONCLIENTMETRICSA
);
2212 ret
= SystemParametersInfoA( uAction
, uParam
, &tmp
, fuWinIni
);
2214 SYSPARAMS_NonClientMetrics32ATo16( &tmp
, lpnm16
);
2216 else /* winfile 95 sets cbSize to 340 */
2217 ret
= SystemParametersInfoA( uAction
, uParam
, lpvParam
, fuWinIni
);
2221 case SPI_GETWORKAREA
: /* 48 WINVER >= 0x400 */
2224 ret
= SystemParametersInfoA( uAction
, uParam
, lpvParam
? &tmp
: NULL
, fuWinIni
);
2225 if (ret
&& lpvParam
)
2226 CONV_RECT32TO16( &tmp
, (RECT16
*)lpvParam
);
2230 case SPI_GETMOUSEHOVERWIDTH
: /* 98 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
2231 case SPI_GETMOUSEHOVERHEIGHT
: /* 100 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
2232 case SPI_GETMOUSEHOVERTIME
: /* 102 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
2235 ret
= SystemParametersInfoA( uAction
, uParam
, lpvParam
? &tmp
: NULL
, fuWinIni
);
2236 if (ret
&& lpvParam
)
2237 *(UINT16
*)lpvParam
= tmp
;
2242 ret
= SystemParametersInfoA( uAction
, uParam
, lpvParam
, fuWinIni
);
2248 /***********************************************************************
2249 * SystemParametersInfoA (USER32.@)
2251 BOOL WINAPI
SystemParametersInfoA( UINT uiAction
, UINT uiParam
,
2252 PVOID pvParam
, UINT fuWinIni
)
2256 TRACE("(%u, %u, %p, %u)\n", uiAction
, uiParam
, pvParam
, fuWinIni
);
2260 case SPI_SETDESKWALLPAPER
: /* 20 */
2261 case SPI_SETDESKPATTERN
: /* 21 */
2265 if (!MultiByteToWideChar( CP_ACP
, 0, (LPSTR
)pvParam
, -1,
2266 buffer
, sizeof(buffer
)/sizeof(WCHAR
) ))
2267 buffer
[sizeof(buffer
)/sizeof(WCHAR
)-1] = 0;
2268 ret
= SystemParametersInfoW( uiAction
, uiParam
, pvParam
? buffer
: NULL
, fuWinIni
);
2272 case SPI_GETICONTITLELOGFONT
: /* 31 */
2275 ret
= SystemParametersInfoW( uiAction
, uiParam
, pvParam
? &tmp
: NULL
, fuWinIni
);
2277 SYSPARAMS_LogFont32WTo32A( &tmp
, (LPLOGFONTA
)pvParam
);
2281 case SPI_GETNONCLIENTMETRICS
: /* 41 WINVER >= 0x400 */
2283 NONCLIENTMETRICSW tmp
;
2284 LPNONCLIENTMETRICSA lpnmA
= (LPNONCLIENTMETRICSA
)pvParam
;
2285 if (lpnmA
&& lpnmA
->cbSize
== sizeof(NONCLIENTMETRICSA
))
2287 tmp
.cbSize
= sizeof(NONCLIENTMETRICSW
);
2288 ret
= SystemParametersInfoW( uiAction
, uiParam
, &tmp
, fuWinIni
);
2290 SYSPARAMS_NonClientMetrics32WTo32A( &tmp
, lpnmA
);
2297 case SPI_GETICONMETRICS
: /* 45 WINVER >= 0x400 */
2300 LPICONMETRICSA lpimA
= (LPICONMETRICSA
)pvParam
;
2301 if (lpimA
&& lpimA
->cbSize
== sizeof(ICONMETRICSA
))
2303 tmp
.cbSize
= sizeof(ICONMETRICSW
);
2304 ret
= SystemParametersInfoW( uiAction
, uiParam
, &tmp
, fuWinIni
);
2307 lpimA
->iHorzSpacing
= tmp
.iHorzSpacing
;
2308 lpimA
->iVertSpacing
= tmp
.iVertSpacing
;
2309 lpimA
->iTitleWrap
= tmp
.iTitleWrap
;
2310 SYSPARAMS_LogFont32WTo32A( &tmp
.lfFont
, &lpimA
->lfFont
);
2318 case SPI_GETHIGHCONTRAST
: /* 66 WINVER >= 0x400 */
2321 LPHIGHCONTRASTA lphcA
= (LPHIGHCONTRASTA
)pvParam
;
2322 if (lphcA
&& lphcA
->cbSize
== sizeof(HIGHCONTRASTA
))
2324 tmp
.cbSize
= sizeof(HIGHCONTRASTW
);
2325 ret
= SystemParametersInfoW( uiAction
, uiParam
, &tmp
, fuWinIni
);
2328 lphcA
->dwFlags
= tmp
.dwFlags
;
2329 lphcA
->lpszDefaultScheme
= NULL
; /* FIXME? */
2338 ret
= SystemParametersInfoW( uiAction
, uiParam
, pvParam
, fuWinIni
);
2345 /**********************************************************************
2346 * SetDoubleClickTime (USER32.@)
2348 BOOL WINAPI
SetDoubleClickTime( UINT interval
)
2350 return SystemParametersInfoW(SPI_SETDOUBLECLICKTIME
, interval
, 0, 0);
2354 /**********************************************************************
2355 * GetDoubleClickTime (USER32.@)
2357 UINT WINAPI
GetDoubleClickTime(void)
2361 if (!spi_loaded
[SPI_SETDOUBLECLICKTIME_IDX
])
2363 if (SYSPARAMS_Load( SPI_SETDOUBLECLICKTIME_REGKEY
,
2364 SPI_SETDOUBLECLICKTIME_VALNAME
,
2367 double_click_time
= atoiW( buf
);
2368 if (!double_click_time
) double_click_time
= 500;
2370 spi_loaded
[SPI_SETDOUBLECLICKTIME_IDX
] = TRUE
;
2372 return double_click_time
;