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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
29 #define NONAMELESSUNION
30 #define NONAMELESSSTRUCT
37 #include "wine/winuser16.h"
41 #include "user_private.h"
42 #include "wine/unicode.h"
43 #include "wine/debug.h"
45 WINE_DEFAULT_DEBUG_CHANNEL(system);
47 /* System parameter indexes */
53 SPI_SETKEYBOARDSPEED_IDX,
54 SPI_ICONHORIZONTALSPACING_IDX,
55 SPI_SETSCREENSAVETIMEOUT_IDX,
56 SPI_SETGRIDGRANULARITY_IDX,
57 SPI_SETKEYBOARDDELAY_IDX,
58 SPI_ICONVERTICALSPACING_IDX,
59 SPI_SETICONTITLEWRAP_IDX,
60 SPI_SETMENUDROPALIGNMENT_IDX,
61 SPI_SETDOUBLECLKWIDTH_IDX,
62 SPI_SETDOUBLECLKHEIGHT_IDX,
63 SPI_SETDOUBLECLICKTIME_IDX,
64 SPI_SETMOUSEBUTTONSWAP_IDX,
65 SPI_SETDRAGFULLWINDOWS_IDX,
67 SPI_SETSHOWSOUNDS_IDX,
68 SPI_SETKEYBOARDPREF_IDX,
69 SPI_SETSCREENREADER_IDX,
70 SPI_SETSCREENSAVERRUNNING_IDX,
71 SPI_SETFONTSMOOTHING_IDX,
72 SPI_SETLISTBOXSMOOTHSCROLLING_IDX,
73 SPI_SETMOUSEHOVERWIDTH_IDX,
74 SPI_SETMOUSEHOVERHEIGHT_IDX,
75 SPI_SETMOUSEHOVERTIME_IDX,
76 SPI_SETMOUSESCROLLLINES_IDX,
77 SPI_SETMENUSHOWDELAY_IDX,
78 SPI_SETICONTITLELOGFONT_IDX,
79 SPI_SETLOWPOWERACTIVE_IDX,
80 SPI_SETPOWEROFFACTIVE_IDX,
81 SPI_USERPREFERENCEMASK_IDX,
82 SPI_NONCLIENTMETRICS_IDX,
83 SPI_MINIMIZEDMETRICS_IDX,
88 static const char * const DefSysColors[] =
90 "Scrollbar", "212 208 200", /* COLOR_SCROLLBAR */
91 "Background", "58 110 165", /* COLOR_BACKGROUND */
92 "ActiveTitle", "0 0 128", /* COLOR_ACTIVECAPTION */
93 "InactiveTitle", "128 128 128", /* COLOR_INACTIVECAPTION */
94 "Menu", "212 208 200", /* COLOR_MENU */
95 "Window", "255 255 255", /* COLOR_WINDOW */
96 "WindowFrame", "0 0 0", /* COLOR_WINDOWFRAME */
97 "MenuText", "0 0 0", /* COLOR_MENUTEXT */
98 "WindowText", "0 0 0", /* COLOR_WINDOWTEXT */
99 "TitleText", "255 255 255", /* COLOR_CAPTIONTEXT */
100 "ActiveBorder", "212 208 200", /* COLOR_ACTIVEBORDER */
101 "InactiveBorder", "212 208 200", /* COLOR_INACTIVEBORDER */
102 "AppWorkSpace", "128 128 128", /* COLOR_APPWORKSPACE */
103 "Hilight", "0 0 128", /* COLOR_HIGHLIGHT */
104 "HilightText", "255 255 255", /* COLOR_HIGHLIGHTTEXT */
105 "ButtonFace", "212 208 200", /* COLOR_BTNFACE */
106 "ButtonShadow", "128 128 128", /* COLOR_BTNSHADOW */
107 "GrayText", "128 128 128", /* COLOR_GRAYTEXT */
108 "ButtonText", "0 0 0", /* COLOR_BTNTEXT */
109 "InactiveTitleText", "212 208 200", /* COLOR_INACTIVECAPTIONTEXT */
110 "ButtonHilight", "255 255 255", /* COLOR_BTNHIGHLIGHT */
111 "ButtonDkShadow", "64 64 64", /* COLOR_3DDKSHADOW */
112 "ButtonLight", "212 208 200", /* COLOR_3DLIGHT */
113 "InfoText", "0 0 0", /* COLOR_INFOTEXT */
114 "InfoWindow", "255 255 225", /* COLOR_INFOBK */
115 "ButtonAlternateFace", "180 180 180", /* COLOR_ALTERNATEBTNFACE */
116 "HotTrackingColor", "0 0 255", /* COLOR_HOTLIGHT */
117 "GradientActiveTitle", "16 132 208", /* COLOR_GRADIENTACTIVECAPTION */
118 "GradientInactiveTitle", "181 181 181", /* COLOR_GRADIENTINACTIVECAPTION */
119 "MenuHilight", "0 0 0", /* COLOR_MENUHILIGHT */
120 "MenuBar", "212 208 200" /* COLOR_MENUBAR */
124 * Names of the registry subkeys of HKEY_CURRENT_USER key and value names
125 * for the system parameters.
126 * Names of the keys are created by adding string "_REGKEY" to
127 * "SET" action names, value names are created by adding "_REG_NAME"
128 * to the "SET" action name.
130 static const WCHAR SPI_SETBEEP_REGKEY[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','S','o','u','n','d',0};
131 static const WCHAR SPI_SETBEEP_VALNAME[]= {'B','e','e','p',0};
132 static const WCHAR SPI_SETMOUSE_REGKEY[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','M','o','u','s','e',0};
133 static const WCHAR SPI_SETMOUSE_VALNAME1[]= {'M','o','u','s','e','T','h','r','e','s','h','o','l','d','1',0};
134 static const WCHAR SPI_SETMOUSE_VALNAME2[]= {'M','o','u','s','e','T','h','r','e','s','h','o','l','d','2',0};
135 static const WCHAR SPI_SETMOUSE_VALNAME3[]= {'M','o','u','s','e','S','p','e','e','d',0};
136 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','\\',
137 'W','i','n','d','o','w','M','e','t','r','i','c','s',0};
138 static const WCHAR SPI_SETBORDER_VALNAME[]= {'B','o','r','d','e','r','W','i','d','t','h',0};
139 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};
140 static const WCHAR SPI_SETKEYBOARDSPEED_VALNAME[]= {'K','e','y','b','o','a','r','d','S','p','e','e','d',0};
141 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','\\',
142 'W','i','n','d','o','w','M','e','t','r','i','c','s',0};
143 static const WCHAR SPI_ICONHORIZONTALSPACING_VALNAME[]= {'I','c','o','n','S','p','a','c','i','n','g',0};
144 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};
145 static const WCHAR SPI_SETSCREENSAVETIMEOUT_VALNAME[]= {'S','c','r','e','e','n','S','a','v','e','T','i','m','e','O','u','t',0};
146 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};
147 static const WCHAR SPI_SETSCREENSAVEACTIVE_VALNAME[]= {'S','c','r','e','e','n','S','a','v','e','A','c','t','i','v','e',0};
148 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};
149 static const WCHAR SPI_SETGRIDGRANULARITY_VALNAME[]= {'G','r','i','d','G','r','a','n','u','l','a','r','i','t','y',0};
150 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};
151 static const WCHAR SPI_SETKEYBOARDDELAY_VALNAME[]= {'K','e','y','b','o','a','r','d','D','e','l','a','y',0};
152 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','\\',
153 'W','i','n','d','o','w','M','e','t','r','i','c','s',0};
154 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};
155 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','\\',
156 'W','i','n','d','o','w','M','e','t','r','i','c','s',0};
157 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};
158 static const WCHAR SPI_SETICONTITLEWRAP_VALNAME[]= {'I','c','o','n','T','i','t','l','e','W','r','a','p',0};
159 static const WCHAR SPI_SETICONTITLELOGFONT_REGKEY[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p','\\',
160 'W','i','n','d','o','w','M','e','t','r','i','c','s',0};
161 static const WCHAR SPI_SETICONTITLELOGFONT_VALNAME[]= {'I','c','o','n','F','o','n','t',0};
162 static const WCHAR SPI_SETMENUDROPALIGNMENT_REGKEY1[]= {'S','o','f','t','w','a','r','e','\\',
163 'M','i','c','r','o','s','o','f','t','\\',
164 'W','i','n','d','o','w','s',' ','N','T','\\',
165 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
166 'W','i','n','d','o','w','s',0};
167 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};
168 static const WCHAR SPI_SETMENUDROPALIGNMENT_VALNAME[]= {'M','e','n','u','D','r','o','p','A','l','i','g','n','m','e','n','t',0};
169 static const WCHAR SPI_SETDOUBLECLKWIDTH_REGKEY1[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','M','o','u','s','e',0};
170 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};
171 static const WCHAR SPI_SETDOUBLECLKWIDTH_VALNAME[]= {'D','o','u','b','l','e','C','l','i','c','k','W','i','d','t','h',0};
172 static const WCHAR SPI_SETDOUBLECLKHEIGHT_REGKEY1[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','M','o','u','s','e',0};
173 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};
174 static const WCHAR SPI_SETDOUBLECLKHEIGHT_VALNAME[]= {'D','o','u','b','l','e','C','l','i','c','k','H','e','i','g','h','t',0};
175 static const WCHAR SPI_SETDOUBLECLICKTIME_REGKEY[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','M','o','u','s','e',0};
176 static const WCHAR SPI_SETDOUBLECLICKTIME_VALNAME[]= {'D','o','u','b','l','e','C','l','i','c','k','S','p','e','e','d',0};
177 static const WCHAR SPI_SETMOUSEBUTTONSWAP_REGKEY[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','M','o','u','s','e',0};
178 static const WCHAR SPI_SETMOUSEBUTTONSWAP_VALNAME[]= {'S','w','a','p','M','o','u','s','e','B','u','t','t','o','n','s',0};
179 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};
180 static const WCHAR SPI_SETDRAGFULLWINDOWS_VALNAME[]= {'D','r','a','g','F','u','l','l','W','i','n','d','o','w','s',0};
181 static const WCHAR SPI_SETSHOWSOUNDS_REGKEY[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\',
182 'A','c','c','e','s','s','i','b','i','l','i','t','y','\\',
183 'S','h','o','w','S','o','u','n','d','s',0};
184 static const WCHAR SPI_SETSHOWSOUNDS_VALNAME[]= {'O','n',0};
185 static const WCHAR SPI_SETKEYBOARDPREF_REGKEY[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\',
186 'A','c','c','e','s','s','i','b','i','l','i','t','y','\\',
187 'K','e','y','b','o','a','r','d',' ','P','r','e','f','e','r','e','n','c','e',0};
188 static const WCHAR SPI_SETKEYBOARDPREF_VALNAME[]= {'O','n',0};
189 static const WCHAR SPI_SETSCREENREADER_REGKEY[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\',
190 'A','c','c','e','s','s','i','b','i','l','i','t','y','\\',
191 'B','l','i','n','d',' ','A','c','c','e','s','s',0};
192 static const WCHAR SPI_SETSCREENREADER_VALNAME[]= {'O','n',0};
193 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};
194 static const WCHAR SPI_SETDESKWALLPAPER_VALNAME[]= {'W','a','l','l','p','a','p','e','r',0};
195 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};
196 static const WCHAR SPI_SETFONTSMOOTHING_VALNAME[]= {'F','o','n','t','S','m','o','o','t','h','i','n','g',0};
197 static const WCHAR SPI_SETLOWPOWERACTIVE_REGKEY[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0};
198 static const WCHAR SPI_SETLOWPOWERACTIVE_VALNAME[]= {'L','o','w','P','o','w','e','r','A','c','t','i','v','e',0};
199 static const WCHAR SPI_SETPOWEROFFACTIVE_REGKEY[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0};
200 static const WCHAR SPI_SETPOWEROFFACTIVE_VALNAME[]= {'P','o','w','e','r','O','f','f','A','c','t','i','v','e',0};
201 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};
202 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};
203 static const WCHAR SPI_SETMOUSEHOVERWIDTH_REGKEY[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','M','o','u','s','e',0};
204 static const WCHAR SPI_SETMOUSEHOVERWIDTH_VALNAME[]= {'M','o','u','s','e','H','o','v','e','r','W','i','d','t','h',0};
205 static const WCHAR SPI_SETMOUSEHOVERHEIGHT_REGKEY[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','M','o','u','s','e',0};
206 static const WCHAR SPI_SETMOUSEHOVERHEIGHT_VALNAME[]= {'M','o','u','s','e','H','o','v','e','r','H','e','i','g','h','t',0};
207 static const WCHAR SPI_SETMOUSEHOVERTIME_REGKEY[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','M','o','u','s','e',0};
208 static const WCHAR SPI_SETMOUSEHOVERTIME_VALNAME[]= {'M','o','u','s','e','H','o','v','e','r','T','i','m','e',0};
209 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};
210 static const WCHAR SPI_SETMOUSESCROLLLINES_VALNAME[]= {'W','h','e','e','l','S','c','r','o','l','l','L','i','n','e','s',0};
211 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};
212 static const WCHAR SPI_SETMENUSHOWDELAY_VALNAME[]= {'M','e','n','u','S','h','o','w','D','e','l','a','y',0};
213 static const WCHAR SPI_CARETWIDTH_REGKEY[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0};
214 static const WCHAR SPI_CARETWIDTH_VALNAME[]= {'C','a','r','e','t','W','i','d','t','h',0};
216 /* FIXME - real values */
217 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};
218 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};
220 static const WCHAR METRICS_REGKEY[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p','\\',
221 'W','i','n','d','o','w','M','e','t','r','i','c','s',0};
222 static const WCHAR METRICS_SCROLLWIDTH_VALNAME[]= {'S','c','r','o','l','l','W','i','d','t','h',0};
223 static const WCHAR METRICS_SCROLLHEIGHT_VALNAME[]= {'S','c','r','o','l','l','H','e','i','g','h','t',0};
224 static const WCHAR METRICS_CAPTIONWIDTH_VALNAME[]= {'C','a','p','t','i','o','n','W','i','d','t','h',0};
225 static const WCHAR METRICS_CAPTIONHEIGHT_VALNAME[]= {'C','a','p','t','i','o','n','H','e','i','g','h','t',0};
226 static const WCHAR METRICS_SMCAPTIONWIDTH_VALNAME[]= {'S','m','C','a','p','t','i','o','n','W','i','d','t','h',0};
227 static const WCHAR METRICS_SMCAPTIONHEIGHT_VALNAME[]= {'S','m','C','a','p','t','i','o','n','H','e','i','g','h','t',0};
228 static const WCHAR METRICS_MENUWIDTH_VALNAME[]= {'M','e','n','u','W','i','d','t','h',0};
229 static const WCHAR METRICS_MENUHEIGHT_VALNAME[]= {'M','e','n','u','H','e','i','g','h','t',0};
230 static const WCHAR METRICS_ICONSIZE_VALNAME[]= {'S','h','e','l','l',' ','I','c','o','n',' ','S','i','z','e',0};
231 static const WCHAR METRICS_BORDERWIDTH_VALNAME[]= {'B','o','r','d','e','r','W','i','d','t','h',0};
232 static const WCHAR METRICS_CAPTIONLOGFONT_VALNAME[]= {'C','a','p','t','i','o','n','F','o','n','t',0};
233 static const WCHAR METRICS_SMCAPTIONLOGFONT_VALNAME[]={'S','m','C','a','p','t','i','o','n','F','o','n','t',0};
234 static const WCHAR METRICS_MENULOGFONT_VALNAME[]= {'M','e','n','u','F','o','n','t',0};
235 static const WCHAR METRICS_MESSAGELOGFONT_VALNAME[]= {'M','e','s','s','a','g','e','F','o','n','t',0};
236 static const WCHAR METRICS_STATUSLOGFONT_VALNAME[]= {'S','t','a','t','u','s','F','o','n','t',0};
237 /* minimized metrics */
238 static const WCHAR METRICS_MINWIDTH_VALNAME[] = {'M','i','n','W','i','d','t','h','\0'};
239 static const WCHAR METRICS_MINHORZGAP_VALNAME[] = {'M','i','n','H','o','r','z','G','a','p','\0'};
240 static const WCHAR METRICS_MINVERTGAP_VALNAME[] = {'M','i','n','V','e','r','t','G','a','p','\0'};
241 static const WCHAR METRICS_MINARRANGE_VALNAME[] = {'M','i','n','A','r','r','a','n','g','e','\0'};
243 static const WCHAR WINE_CURRENT_USER_REGKEY[] = {'S','o','f','t','w','a','r','e','\\',
246 /* volatile registry branch under WINE_CURRENT_USER_REGKEY for temporary values storage */
247 static const WCHAR WINE_CURRENT_USER_REGKEY_TEMP_PARAMS[] = {'T','e','m','p','o','r','a','r','y',' ',
248 'S','y','s','t','e','m',' ',
249 'P','a','r','a','m','e','t','e','r','s',0};
251 static const WCHAR Yes[]= {'Y','e','s',0};
252 static const WCHAR No[]= {'N','o',0};
253 static const WCHAR Desktop[]= {'D','e','s','k','t','o','p',0};
254 static const WCHAR Pattern[]= {'P','a','t','t','e','r','n',0};
255 static const WCHAR MenuFont[]= {'M','e','n','u','F','o','n','t',0};
256 static const WCHAR MenuFontSize[]= {'M','e','n','u','F','o','n','t','S','i','z','e',0};
257 static const WCHAR StatusFont[]= {'S','t','a','t','u','s','F','o','n','t',0};
258 static const WCHAR StatusFontSize[]= {'S','t','a','t','u','s','F','o','n','t','S','i','z','e',0};
259 static const WCHAR MessageFont[]= {'M','e','s','s','a','g','e','F','o','n','t',0};
260 static const WCHAR MessageFontSize[]= {'M','e','s','s','a','g','e','F','o','n','t','S','i','z','e',0};
261 static const WCHAR System[]= {'S','y','s','t','e','m',0};
262 static const WCHAR IconTitleSize[]= {'I','c','o','n','T','i','t','l','e','S','i','z','e',0};
263 static const WCHAR IconTitleFaceName[]= {'I','c','o','n','T','i','t','l','e','F','a','c','e','N','a','m','e',0};
264 static const WCHAR defPattern[]= {'0',' ','0',' ','0',' ','0',' ','0',' ','0',' ','0',' ','0',0};
265 static const WCHAR CSu[]= {'%','u',0};
266 static const WCHAR CSd[]= {'%','d',0};
268 /* Indicators whether system parameter value is loaded */
269 static char spi_loaded[SPI_INDEX_COUNT];
271 static BOOL notify_change = TRUE;
273 /* System parameters storage */
274 static BOOL beep_active = TRUE;
275 static int mouse_threshold1 = 6;
276 static int mouse_threshold2 = 10;
277 static int mouse_speed = 1;
278 static UINT border = 1;
279 static UINT keyboard_speed = 31;
280 static UINT screensave_timeout = 300;
281 static UINT grid_granularity = 0;
282 static UINT keyboard_delay = 1;
283 static UINT double_click_width = 4;
284 static UINT double_click_height = 4;
285 static UINT double_click_time = 500;
286 static BOOL drag_full_windows = FALSE;
287 static RECT work_area;
288 static BOOL keyboard_pref = TRUE;
289 static BOOL screen_reader = FALSE;
290 static UINT mouse_hover_width = 4;
291 static UINT mouse_hover_height = 4;
292 static UINT mouse_hover_time = 400;
293 static UINT mouse_scroll_lines = 3;
294 static UINT menu_show_delay = 400;
295 static UINT menu_drop_alignment = 0;
296 static BOOL screensaver_running = FALSE;
297 static UINT font_smoothing = 0; /* 0x01 for 95/98/NT, 0x02 for 98/ME/2k/XP */
298 static BOOL lowpoweractive = FALSE;
299 static BOOL poweroffactive = FALSE;
300 static BOOL show_sounds = FALSE;
301 static BOOL swap_buttons = FALSE;
302 static UINT caret_width = 1;
303 static BYTE user_prefs[4];
305 static MINIMIZEDMETRICS minimized_metrics =
307 sizeof(MINIMIZEDMETRICS),
311 ARW_HIDE /* iArrange */
314 static ICONMETRICSW icon_metrics =
316 sizeof(ICONMETRICSW),
317 75, /* iHorzSpacing */
318 75, /* iVertSpacing */
319 TRUE, /* iTitleWrap */
320 { -11, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET,
321 OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH } /* lfFont */
324 static NONCLIENTMETRICSW nonclient_metrics =
326 sizeof(NONCLIENTMETRICSW),
327 1, /* iBorderWidth */
328 16, /* iScrollWidth */
329 16, /* iScrollHeight */
330 18, /* iCaptionWidth */
331 18, /* iCaptionHeight */
332 { 0 }, /* lfCaptionFont */
333 13, /* iSmCaptionWidth */
334 15, /* iSmCaptionHeight */
335 { 0 }, /* lfSmCaptionFont */
337 18, /* iMenuHeight */
338 { 0 }, /* lfMenuFont */
339 { 0 }, /* lfStatusFont */
340 { 0 } /* lfMessageFont */
343 /* some additional non client metric info */
344 static TEXTMETRICW tmMenuFont;
345 static UINT CaptionFontAvCharWidth;
347 static SIZE icon_size = { 32, 32 };
349 #define NUM_SYS_COLORS (COLOR_MENUBAR+1)
351 static COLORREF SysColors[NUM_SYS_COLORS];
352 static HBRUSH SysColorBrushes[NUM_SYS_COLORS];
353 static HPEN SysColorPens[NUM_SYS_COLORS];
355 static const WORD wPattern55AA[] = { 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xaaaa };
357 HBRUSH SYSCOLOR_55AABrush = 0;
359 extern void __wine_make_gdi_object_system( HGDIOBJ handle, BOOL set );
362 /* This function is a copy of the one in objects/font.c */
363 static void SYSPARAMS_LogFont32ATo16( const LOGFONTA* font32, LPLOGFONT16 font16 )
365 font16->lfHeight = font32->lfHeight;
366 font16->lfWidth = font32->lfWidth;
367 font16->lfEscapement = font32->lfEscapement;
368 font16->lfOrientation = font32->lfOrientation;
369 font16->lfWeight = font32->lfWeight;
370 font16->lfItalic = font32->lfItalic;
371 font16->lfUnderline = font32->lfUnderline;
372 font16->lfStrikeOut = font32->lfStrikeOut;
373 font16->lfCharSet = font32->lfCharSet;
374 font16->lfOutPrecision = font32->lfOutPrecision;
375 font16->lfClipPrecision = font32->lfClipPrecision;
376 font16->lfQuality = font32->lfQuality;
377 font16->lfPitchAndFamily = font32->lfPitchAndFamily;
378 lstrcpynA( font16->lfFaceName, font32->lfFaceName, LF_FACESIZE );
381 static void SYSPARAMS_LogFont16To32W( const LOGFONT16 *font16, LPLOGFONTW font32 )
383 font32->lfHeight = font16->lfHeight;
384 font32->lfWidth = font16->lfWidth;
385 font32->lfEscapement = font16->lfEscapement;
386 font32->lfOrientation = font16->lfOrientation;
387 font32->lfWeight = font16->lfWeight;
388 font32->lfItalic = font16->lfItalic;
389 font32->lfUnderline = font16->lfUnderline;
390 font32->lfStrikeOut = font16->lfStrikeOut;
391 font32->lfCharSet = font16->lfCharSet;
392 font32->lfOutPrecision = font16->lfOutPrecision;
393 font32->lfClipPrecision = font16->lfClipPrecision;
394 font32->lfQuality = font16->lfQuality;
395 font32->lfPitchAndFamily = font16->lfPitchAndFamily;
396 MultiByteToWideChar( CP_ACP, 0, font16->lfFaceName, -1, font32->lfFaceName, LF_FACESIZE );
397 font32->lfFaceName[LF_FACESIZE-1] = 0;
400 static void SYSPARAMS_LogFont32WTo32A( const LOGFONTW* font32W, LPLOGFONTA font32A )
402 font32A->lfHeight = font32W->lfHeight;
403 font32A->lfWidth = font32W->lfWidth;
404 font32A->lfEscapement = font32W->lfEscapement;
405 font32A->lfOrientation = font32W->lfOrientation;
406 font32A->lfWeight = font32W->lfWeight;
407 font32A->lfItalic = font32W->lfItalic;
408 font32A->lfUnderline = font32W->lfUnderline;
409 font32A->lfStrikeOut = font32W->lfStrikeOut;
410 font32A->lfCharSet = font32W->lfCharSet;
411 font32A->lfOutPrecision = font32W->lfOutPrecision;
412 font32A->lfClipPrecision = font32W->lfClipPrecision;
413 font32A->lfQuality = font32W->lfQuality;
414 font32A->lfPitchAndFamily = font32W->lfPitchAndFamily;
415 WideCharToMultiByte( CP_ACP, 0, font32W->lfFaceName, -1, font32A->lfFaceName, LF_FACESIZE, NULL, NULL );
416 font32A->lfFaceName[LF_FACESIZE-1] = 0;
419 static void SYSPARAMS_LogFont32ATo32W( const LOGFONTA* font32A, LPLOGFONTW font32W )
421 font32W->lfHeight = font32A->lfHeight;
422 font32W->lfWidth = font32A->lfWidth;
423 font32W->lfEscapement = font32A->lfEscapement;
424 font32W->lfOrientation = font32A->lfOrientation;
425 font32W->lfWeight = font32A->lfWeight;
426 font32W->lfItalic = font32A->lfItalic;
427 font32W->lfUnderline = font32A->lfUnderline;
428 font32W->lfStrikeOut = font32A->lfStrikeOut;
429 font32W->lfCharSet = font32A->lfCharSet;
430 font32W->lfOutPrecision = font32A->lfOutPrecision;
431 font32W->lfClipPrecision = font32A->lfClipPrecision;
432 font32W->lfQuality = font32A->lfQuality;
433 font32W->lfPitchAndFamily = font32A->lfPitchAndFamily;
434 MultiByteToWideChar( CP_ACP, 0, font32A->lfFaceName, -1, font32W->lfFaceName, LF_FACESIZE );
435 font32W->lfFaceName[LF_FACESIZE-1] = 0;
438 static void SYSPARAMS_NonClientMetrics32ATo16( const NONCLIENTMETRICSA* lpnm32, LPNONCLIENTMETRICS16 lpnm16 )
440 lpnm16->iBorderWidth = lpnm32->iBorderWidth;
441 lpnm16->iScrollWidth = lpnm32->iScrollWidth;
442 lpnm16->iScrollHeight = lpnm32->iScrollHeight;
443 lpnm16->iCaptionWidth = lpnm32->iCaptionWidth;
444 lpnm16->iCaptionHeight = lpnm32->iCaptionHeight;
445 SYSPARAMS_LogFont32ATo16( &lpnm32->lfCaptionFont, &lpnm16->lfCaptionFont );
446 lpnm16->iSmCaptionWidth = lpnm32->iSmCaptionWidth;
447 lpnm16->iSmCaptionHeight = lpnm32->iSmCaptionHeight;
448 SYSPARAMS_LogFont32ATo16( &lpnm32->lfSmCaptionFont, &lpnm16->lfSmCaptionFont );
449 lpnm16->iMenuWidth = lpnm32->iMenuWidth;
450 lpnm16->iMenuHeight = lpnm32->iMenuHeight;
451 SYSPARAMS_LogFont32ATo16( &lpnm32->lfMenuFont, &lpnm16->lfMenuFont );
452 SYSPARAMS_LogFont32ATo16( &lpnm32->lfStatusFont, &lpnm16->lfStatusFont );
453 SYSPARAMS_LogFont32ATo16( &lpnm32->lfMessageFont, &lpnm16->lfMessageFont );
456 static void SYSPARAMS_NonClientMetrics32WTo32A( const NONCLIENTMETRICSW* lpnm32W, LPNONCLIENTMETRICSA lpnm32A )
458 lpnm32A->iBorderWidth = lpnm32W->iBorderWidth;
459 lpnm32A->iScrollWidth = lpnm32W->iScrollWidth;
460 lpnm32A->iScrollHeight = lpnm32W->iScrollHeight;
461 lpnm32A->iCaptionWidth = lpnm32W->iCaptionWidth;
462 lpnm32A->iCaptionHeight = lpnm32W->iCaptionHeight;
463 SYSPARAMS_LogFont32WTo32A( &lpnm32W->lfCaptionFont, &lpnm32A->lfCaptionFont );
464 lpnm32A->iSmCaptionWidth = lpnm32W->iSmCaptionWidth;
465 lpnm32A->iSmCaptionHeight = lpnm32W->iSmCaptionHeight;
466 SYSPARAMS_LogFont32WTo32A( &lpnm32W->lfSmCaptionFont, &lpnm32A->lfSmCaptionFont );
467 lpnm32A->iMenuWidth = lpnm32W->iMenuWidth;
468 lpnm32A->iMenuHeight = lpnm32W->iMenuHeight;
469 SYSPARAMS_LogFont32WTo32A( &lpnm32W->lfMenuFont, &lpnm32A->lfMenuFont );
470 SYSPARAMS_LogFont32WTo32A( &lpnm32W->lfStatusFont, &lpnm32A->lfStatusFont );
471 SYSPARAMS_LogFont32WTo32A( &lpnm32W->lfMessageFont, &lpnm32A->lfMessageFont );
474 static void SYSPARAMS_NonClientMetrics32ATo32W( const NONCLIENTMETRICSA* lpnm32A, LPNONCLIENTMETRICSW lpnm32W )
476 lpnm32W->iBorderWidth = lpnm32A->iBorderWidth;
477 lpnm32W->iScrollWidth = lpnm32A->iScrollWidth;
478 lpnm32W->iScrollHeight = lpnm32A->iScrollHeight;
479 lpnm32W->iCaptionWidth = lpnm32A->iCaptionWidth;
480 lpnm32W->iCaptionHeight = lpnm32A->iCaptionHeight;
481 SYSPARAMS_LogFont32ATo32W( &lpnm32A->lfCaptionFont, &lpnm32W->lfCaptionFont );
482 lpnm32W->iSmCaptionWidth = lpnm32A->iSmCaptionWidth;
483 lpnm32W->iSmCaptionHeight = lpnm32A->iSmCaptionHeight;
484 SYSPARAMS_LogFont32ATo32W( &lpnm32A->lfSmCaptionFont, &lpnm32W->lfSmCaptionFont );
485 lpnm32W->iMenuWidth = lpnm32A->iMenuWidth;
486 lpnm32W->iMenuHeight = lpnm32A->iMenuHeight;
487 SYSPARAMS_LogFont32ATo32W( &lpnm32A->lfMenuFont, &lpnm32W->lfMenuFont );
488 SYSPARAMS_LogFont32ATo32W( &lpnm32A->lfStatusFont, &lpnm32W->lfStatusFont );
489 SYSPARAMS_LogFont32ATo32W( &lpnm32A->lfMessageFont, &lpnm32W->lfMessageFont );
493 /* Helper functions to retrieve monitors info */
501 static BOOL CALLBACK monitor_info_proc( HMONITOR monitor, HDC hdc, LPRECT rect, LPARAM lp )
503 struct monitor_info *info = (struct monitor_info *)lp;
505 UnionRect( &info->virtual_rect, &info->virtual_rect, rect );
509 static void get_monitors_info( struct monitor_info *info )
512 SetRectEmpty( &info->virtual_rect );
513 EnumDisplayMonitors( 0, NULL, monitor_info_proc, (LPARAM)info );
517 /* get text metrics and/or "average" char width of the specified logfont
518 * for the specified dc */
519 static void get_text_metr_size( HDC hdc, LOGFONTW *plf, TEXTMETRICW * ptm, UINT *psz)
521 HFONT hfont, hfontsav;
524 hfont = CreateFontIndirectW( plf);
525 if( !hfont || ( hfontsav = SelectObject( hdc, hfont)) == NULL ) {
528 if( hfont) DeleteObject( hfont);
531 GetTextMetricsW( hdc, ptm);
533 if( !(*psz = GdiGetCharDimensions( hdc, ptm, NULL)))
535 SelectObject( hdc, hfontsav);
536 DeleteObject( hfont);
539 /***********************************************************************
540 * get_volatile_regkey
542 * Return a handle to the volatile registry key used to store
543 * non-permanently modified parameters.
545 static HKEY get_volatile_regkey(void)
547 static HKEY volatile_key;
552 /* This must be non-volatile! */
553 if (RegCreateKeyExW( HKEY_CURRENT_USER, WINE_CURRENT_USER_REGKEY,
554 0, 0, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 0,
555 &key, 0 ) != ERROR_SUCCESS)
557 ERR("Can't create wine registry branch\n");
561 /* @@ Wine registry key: HKCU\Software\Wine\Temporary System Parameters */
562 if (RegCreateKeyExW( key, WINE_CURRENT_USER_REGKEY_TEMP_PARAMS,
563 0, 0, REG_OPTION_VOLATILE, KEY_ALL_ACCESS, 0,
564 &volatile_key, 0 ) != ERROR_SUCCESS)
565 ERR("Can't create non-permanent wine registry branch\n");
573 /***********************************************************************
574 * SYSPARAMS_NotifyChange
576 * Sends notification about system parameter update.
578 static void SYSPARAMS_NotifyChange( UINT uiAction, UINT fWinIni )
580 static const WCHAR emptyW[1];
584 if (fWinIni & SPIF_UPDATEINIFILE)
586 if (fWinIni & (SPIF_SENDWININICHANGE | SPIF_SENDCHANGE))
587 SendMessageTimeoutW(HWND_BROADCAST, WM_SETTINGCHANGE,
588 uiAction, (LPARAM) emptyW,
589 SMTO_ABORTIFHUNG, 2000, NULL );
593 /* FIXME notify other wine processes with internal message */
599 /***********************************************************************
600 * Loads system parameter from user profile.
602 static BOOL SYSPARAMS_LoadRaw( LPCWSTR lpRegKey, LPCWSTR lpValName, LPBYTE lpBuf, DWORD count )
608 memset( lpBuf, 0, count );
609 if ((RegOpenKeyW( get_volatile_regkey(), lpRegKey, &hKey ) == ERROR_SUCCESS) ||
610 (RegOpenKeyW( HKEY_CURRENT_USER, lpRegKey, &hKey ) == ERROR_SUCCESS))
612 ret = !RegQueryValueExW( hKey, lpValName, NULL, &type, (LPBYTE)lpBuf, &count);
618 static BOOL SYSPARAMS_Load( LPCWSTR lpRegKey, LPCWSTR lpValName, LPWSTR lpBuf, DWORD count )
620 return SYSPARAMS_LoadRaw( lpRegKey, lpValName, (LPBYTE)lpBuf, count );
623 /***********************************************************************
624 * Saves system parameter to user profile.
627 /* Save data as-is */
628 static BOOL SYSPARAMS_SaveRaw( LPCWSTR lpRegKey, LPCWSTR lpValName,
629 const BYTE* lpValue, DWORD valueSize,
630 DWORD type, UINT fWinIni )
637 if (fWinIni & SPIF_UPDATEINIFILE)
639 hBaseKey = HKEY_CURRENT_USER;
644 hBaseKey = get_volatile_regkey();
645 dwOptions = REG_OPTION_VOLATILE;
648 if (RegCreateKeyExW( hBaseKey, lpRegKey,
649 0, 0, dwOptions, KEY_ALL_ACCESS,
650 0, &hKey, 0 ) == ERROR_SUCCESS)
652 if (RegSetValueExW( hKey, lpValName, 0, type,
653 lpValue, valueSize) == ERROR_SUCCESS)
656 if (hBaseKey == HKEY_CURRENT_USER)
657 RegDeleteKeyW( get_volatile_regkey(), lpRegKey );
664 /* Convenience function to save strings */
665 static BOOL SYSPARAMS_Save( LPCWSTR lpRegKey, LPCWSTR lpValName, LPCWSTR lpValue,
668 return SYSPARAMS_SaveRaw( lpRegKey, lpValName, (const BYTE*)lpValue,
669 (strlenW(lpValue) + 1)*sizeof(WCHAR), REG_SZ, fWinIni );
672 /* Convenience function to save logical fonts */
673 static BOOL SYSPARAMS_SaveLogFont( LPCWSTR lpRegKey, LPCWSTR lpValName,
674 LPLOGFONTW plf, UINT fWinIni )
676 return SYSPARAMS_SaveRaw( lpRegKey, lpValName, (const BYTE*)plf,
677 sizeof( LOGFONTW), REG_BINARY, fWinIni );
681 static inline HDC get_display_dc(void)
683 static const WCHAR DISPLAY[] = {'D','I','S','P','L','A','Y',0};
684 static HDC display_dc;
685 if (!display_dc) display_dc = CreateICW( DISPLAY, NULL, NULL, NULL );
689 static inline int get_display_dpi(void)
691 static int display_dpi;
692 if (!display_dpi) display_dpi = GetDeviceCaps( get_display_dc(), LOGPIXELSY );
696 /***********************************************************************
697 * SYSPARAMS_Twips2Pixels
699 * Convert a dimension value that was obtained from the registry. These are
700 * quoted as being "twips" values if negative and pixels if positive.
701 * One inch is 1440 twips. So to convert, divide by 1440 to get inches and
702 * multiply that by the dots-per-inch to get the size in pixels.
704 * MSDN Library - April 2001 -> Resource Kits ->
705 * Windows 2000 Resource Kit Reference ->
706 * Technical Reference to the Windows 2000 Registry ->
707 * HKEY_CURRENT_USER -> Control Panel -> Desktop -> WindowMetrics
709 static inline int SYSPARAMS_Twips2Pixels(int x)
712 x = (-x * get_display_dpi() + 720) / 1440;
716 /***********************************************************************
719 * Get a registry entry from the already open key. This allows us to open the
720 * section once and read several values.
722 * Of course this function belongs somewhere more usable but here will do
725 static int get_reg_metric( HKEY hkey, LPCWSTR lpValName, int default_value )
727 int value = default_value;
731 DWORD type, count = sizeof(buffer);
732 if(!RegQueryValueExW( hkey, lpValName, NULL, &type, (LPBYTE)buffer, &count) )
736 /* Are there any utilities for converting registry entries
739 /* FIXME_(reg)("We need reg format converter\n"); */
742 value = atoiW(buffer);
745 return SYSPARAMS_Twips2Pixels(value);
749 /*************************************************************************
750 * SYSPARAMS_SetSysColor
752 static void SYSPARAMS_SetSysColor( int index, COLORREF color )
754 if (index < 0 || index >= NUM_SYS_COLORS) return;
755 SysColors[index] = color;
756 if (SysColorBrushes[index])
758 __wine_make_gdi_object_system( SysColorBrushes[index], FALSE);
759 DeleteObject( SysColorBrushes[index] );
761 SysColorBrushes[index] = CreateSolidBrush( color );
762 __wine_make_gdi_object_system( SysColorBrushes[index], TRUE);
764 if (SysColorPens[index])
766 __wine_make_gdi_object_system( SysColorPens[index], FALSE);
767 DeleteObject( SysColorPens[index] );
769 SysColorPens[index] = CreatePen( PS_SOLID, 1, color );
770 __wine_make_gdi_object_system( SysColorPens[index], TRUE);
773 /* load a uint parameter from the registry */
774 static BOOL get_uint_param( unsigned int idx, LPCWSTR regkey, LPCWSTR value,
775 UINT *value_ptr, UINT *ret_ptr )
777 if (!ret_ptr) return FALSE;
778 if (!spi_loaded[idx])
782 if (SYSPARAMS_Load( regkey, value, buf, sizeof(buf) )) *value_ptr = atoiW( buf );
783 spi_loaded[idx] = TRUE;
785 *ret_ptr = *value_ptr;
789 /* load a twips parameter from the registry */
790 static BOOL get_twips_param( unsigned int idx, LPCWSTR regkey, LPCWSTR value,
791 UINT *value_ptr, UINT *ret_ptr )
793 if (!ret_ptr) return FALSE;
794 if (!spi_loaded[idx])
798 if (SYSPARAMS_Load( regkey, value, buf, sizeof(buf) ))
799 *value_ptr = SYSPARAMS_Twips2Pixels( atoiW(buf) );
800 spi_loaded[idx] = TRUE;
802 *ret_ptr = *value_ptr;
806 /* load a boolean parameter from the registry */
807 static inline BOOL get_bool_param( unsigned int idx, LPCWSTR regkey, LPCWSTR value,
808 BOOL *value_ptr, BOOL *ret_ptr )
810 return get_uint_param( idx, regkey, value, (UINT *)value_ptr, (UINT *)ret_ptr );
813 /* set a uint parameter that is mirrored in two different registry locations */
814 static BOOL set_uint_param_mirrored( unsigned int idx, LPCWSTR regkey, LPCWSTR regkey_mirror,
815 LPCWSTR value, UINT *value_ptr, UINT new_val, UINT fWinIni )
819 wsprintfW(buf, CSu, new_val);
820 if (!SYSPARAMS_Save( regkey, value, buf, fWinIni )) return FALSE;
821 if (regkey_mirror) SYSPARAMS_Save( regkey_mirror, value, buf, fWinIni );
822 *value_ptr = new_val;
823 spi_loaded[idx] = TRUE;
827 /* save an int parameter in registry */
828 static BOOL save_int_param( LPCWSTR regkey, LPCWSTR value, INT *value_ptr,
829 INT new_val, UINT fWinIni )
833 wsprintfW(buf, CSd, new_val);
834 if (!SYSPARAMS_Save( regkey, value, buf, fWinIni )) return FALSE;
835 if( value_ptr) *value_ptr = new_val;
839 /* set an int parameter in the registry */
840 static inline BOOL set_int_param( unsigned int idx, LPCWSTR regkey, LPCWSTR value,
841 INT *value_ptr, INT new_val, UINT fWinIni )
843 BOOL ret = save_int_param( regkey, value, value_ptr, new_val, fWinIni );
844 if (ret) spi_loaded[idx] = TRUE;
848 /* set a uint parameter in the registry */
849 static inline BOOL set_uint_param( unsigned int idx, LPCWSTR regkey, LPCWSTR value,
850 UINT *value_ptr, UINT new_val, UINT fWinIni )
852 return set_uint_param_mirrored( idx, regkey, NULL, value, value_ptr, new_val, fWinIni );
855 /* set a boolean parameter that is mirrored in two different registry locations */
856 static inline BOOL set_bool_param_mirrored( unsigned int idx, LPCWSTR regkey, LPCWSTR regkey_mirror,
857 LPCWSTR value, BOOL *value_ptr, BOOL new_val, UINT fWinIni )
859 return set_uint_param_mirrored( idx, regkey, regkey_mirror, value,
860 (UINT *)value_ptr, new_val, fWinIni );
863 /* set a boolean parameter in the registry */
864 static inline BOOL set_bool_param( unsigned int idx, LPCWSTR regkey, LPCWSTR value,
865 BOOL *value_ptr, BOOL new_val, UINT fWinIni )
867 return set_uint_param( idx, regkey, value, (UINT *)value_ptr, new_val, fWinIni );
870 /* load a boolean parameter from the user preference key */
871 static BOOL get_user_pref_param( UINT offset, UINT mask, BOOL *ret_ptr )
873 if (!ret_ptr) return FALSE;
875 if (!spi_loaded[SPI_USERPREFERENCEMASK_IDX])
877 SYSPARAMS_LoadRaw( SPI_USERPREFERENCEMASK_REGKEY,
878 SPI_USERPREFERENCEMASK_VALNAME,
879 user_prefs, sizeof(user_prefs) );
880 spi_loaded[SPI_USERPREFERENCEMASK_IDX] = TRUE;
882 *ret_ptr = (user_prefs[offset] & mask) != 0;
886 /* set a boolean parameter in the user preference key */
887 static BOOL set_user_pref_param( UINT offset, UINT mask, BOOL value, BOOL fWinIni )
889 SYSPARAMS_LoadRaw( SPI_USERPREFERENCEMASK_REGKEY,
890 SPI_USERPREFERENCEMASK_VALNAME,
891 user_prefs, sizeof(user_prefs) );
892 spi_loaded[SPI_USERPREFERENCEMASK_IDX] = TRUE;
894 if (value) user_prefs[offset] |= mask;
895 else user_prefs[offset] &= ~mask;
897 SYSPARAMS_SaveRaw( SPI_USERPREFERENCEMASK_REGKEY,
898 SPI_USERPREFERENCEMASK_VALNAME,
899 user_prefs, sizeof(user_prefs), REG_BINARY, fWinIni );
903 /***********************************************************************
906 * Initialisation of the system metrics array.
908 void SYSPARAMS_Init(void)
910 HKEY hkey; /* key to the window metrics area of the registry */
915 /* initialize system colors */
917 if (RegCreateKeyExA(HKEY_CURRENT_USER, "Control Panel\\Colors", 0, 0, 0, KEY_ALL_ACCESS, 0, &hkey, 0))
919 for (i = 0; i < NUM_SYS_COLORS; i++)
923 /* first try, registry */
926 DWORD dwDataSize = sizeof(buffer);
927 if (!(RegQueryValueExA(hkey,DefSysColors[i*2], 0, 0, (LPBYTE) buffer, &dwDataSize)))
928 if (sscanf( buffer, "%d %d %d", &r, &g, &b ) == 3) bOk = TRUE;
931 /* second try, win.ini */
934 GetProfileStringA( "colors", DefSysColors[i*2], DefSysColors[i*2+1], buffer, 100 );
935 if (sscanf( buffer, " %d %d %d", &r, &g, &b ) == 3) bOk = TRUE;
938 /* last chance, take the default */
941 int iNumColors = sscanf( DefSysColors[i*2+1], " %d %d %d", &r, &g, &b );
942 assert (iNumColors==3);
945 SYSPARAMS_SetSysColor( i, RGB(r,g,b) );
947 if (hkey) RegCloseKey( hkey );
949 /* create 55AA bitmap */
951 h55AABitmap = CreateBitmap( 8, 8, 1, 1, wPattern55AA );
952 SYSCOLOR_55AABrush = CreatePatternBrush( h55AABitmap );
953 __wine_make_gdi_object_system( SYSCOLOR_55AABrush, TRUE );
957 /***********************************************************************
960 * Tries to retrieve logfont info from the specified key and value
962 static BOOL reg_get_logfont(LPCWSTR key, LPCWSTR value, LOGFONTW *lf)
971 base_keys[0] = get_volatile_regkey();
972 base_keys[1] = HKEY_CURRENT_USER;
974 for(i = 0; i < 2 && !found; i++)
976 if(RegOpenKeyW(base_keys[i], key, &hkey) == ERROR_SUCCESS)
978 size = sizeof(lfbuf);
979 if(RegQueryValueExW(hkey, value, NULL, &type, (LPBYTE)&lfbuf, &size) == ERROR_SUCCESS &&
982 if( size == sizeof(lfbuf))
985 memcpy(lf, &lfbuf, size);
986 } else if( size == sizeof( LOGFONT16))
987 { /* win9x-winME format */
989 SYSPARAMS_LogFont16To32W( (LOGFONT16*) &lfbuf, lf);
991 WARN("Unknown format in key %s value %s, size is %d\n",
992 debugstr_w( key), debugstr_w( value), size);
997 if( found && lf->lfHeight > 0) {
998 /* positive height value means points ( inch/72 ) */
999 lf->lfHeight = -MulDiv( lf->lfHeight, get_display_dpi(), 72);
1004 /* load all the minimized metrics */
1005 static void load_minimized_metrics(void)
1008 if (RegOpenKeyExW (HKEY_CURRENT_USER, METRICS_REGKEY,
1009 0, KEY_QUERY_VALUE, &hkey) != ERROR_SUCCESS) hkey = 0;
1011 minimized_metrics.iWidth = max( get_reg_metric(hkey,
1012 METRICS_MINWIDTH_VALNAME, minimized_metrics.iWidth), 0);
1013 minimized_metrics.iHorzGap = max( get_reg_metric(hkey,
1014 METRICS_MINHORZGAP_VALNAME, minimized_metrics.iHorzGap), 0);
1015 minimized_metrics.iVertGap = max( get_reg_metric(hkey,
1016 METRICS_MINVERTGAP_VALNAME, minimized_metrics.iVertGap), 0);
1017 minimized_metrics.iArrange = 0x0f & get_reg_metric(hkey,
1018 METRICS_MINARRANGE_VALNAME, minimized_metrics.iArrange);
1020 if (hkey) RegCloseKey( hkey );
1021 spi_loaded[SPI_MINIMIZEDMETRICS_IDX] = TRUE;
1024 /* adjust some of the raw values found in the registry */
1025 static void normalize_nonclientmetrics( NONCLIENTMETRICSW *pncm)
1028 if( pncm->iBorderWidth < 1) pncm->iBorderWidth = 1;
1029 if( pncm->iCaptionWidth < 8) pncm->iCaptionWidth = 8;
1030 if( pncm->iScrollWidth < 8) pncm->iScrollWidth = 8;
1031 if( pncm->iScrollHeight < 8) pncm->iScrollHeight = 8;
1033 /* get some extra metrics */
1034 get_text_metr_size( get_display_dc(), &pncm->lfMenuFont,
1036 get_text_metr_size( get_display_dc(), &pncm->lfCaptionFont,
1037 NULL, &CaptionFontAvCharWidth);
1039 /* adjust some heights to the corresponding font */
1040 pncm->iMenuHeight = max( pncm->iMenuHeight,
1041 2 + tmMenuFont.tmHeight + tmMenuFont.tmExternalLeading);
1042 get_text_metr_size( get_display_dc(), &pncm->lfCaptionFont, &tm, NULL);
1043 pncm->iCaptionHeight = max( pncm->iCaptionHeight, 2 + tm.tmHeight);
1044 get_text_metr_size( get_display_dc(), &pncm->lfSmCaptionFont, &tm, NULL);
1045 pncm->iSmCaptionHeight = max( pncm->iSmCaptionHeight, 2 + tm.tmHeight);
1048 /* load all the non-client metrics */
1049 static void load_nonclient_metrics(void)
1052 NONCLIENTMETRICSW ncm;
1055 ncm.cbSize = sizeof (ncm);
1056 if (RegOpenKeyExW (HKEY_CURRENT_USER, METRICS_REGKEY,
1057 0, KEY_QUERY_VALUE, &hkey) != ERROR_SUCCESS) hkey = 0;
1059 /* initialize geometry entries */
1060 ncm.iBorderWidth = get_reg_metric(hkey, METRICS_BORDERWIDTH_VALNAME, 1);
1061 ncm.iScrollWidth = get_reg_metric(hkey, METRICS_SCROLLWIDTH_VALNAME, 16);
1062 ncm.iScrollHeight = get_reg_metric(hkey, METRICS_SCROLLHEIGHT_VALNAME, 16);
1064 /* size of the normal caption buttons */
1065 ncm.iCaptionHeight = get_reg_metric(hkey, METRICS_CAPTIONHEIGHT_VALNAME, 18);
1066 ncm.iCaptionWidth = get_reg_metric(hkey, METRICS_CAPTIONWIDTH_VALNAME, ncm.iCaptionHeight);
1068 /* caption font metrics */
1069 if (!reg_get_logfont(METRICS_REGKEY, METRICS_CAPTIONLOGFONT_VALNAME, &ncm.lfCaptionFont))
1071 SystemParametersInfoW( SPI_GETICONTITLELOGFONT, 0, &ncm.lfCaptionFont, 0 );
1072 ncm.lfCaptionFont.lfWeight = FW_BOLD;
1075 /* size of the small caption buttons */
1076 ncm.iSmCaptionWidth = get_reg_metric(hkey, METRICS_SMCAPTIONWIDTH_VALNAME, 13);
1077 ncm.iSmCaptionHeight = get_reg_metric(hkey, METRICS_SMCAPTIONHEIGHT_VALNAME, 15);
1079 /* small caption font metrics */
1080 if (!reg_get_logfont(METRICS_REGKEY, METRICS_SMCAPTIONLOGFONT_VALNAME, &ncm.lfSmCaptionFont))
1081 SystemParametersInfoW( SPI_GETICONTITLELOGFONT, 0, &ncm.lfSmCaptionFont, 0 );
1083 /* menus, FIXME: names of wine.conf entries are bogus */
1085 /* size of the menu (MDI) buttons */
1086 ncm.iMenuHeight = get_reg_metric(hkey, METRICS_MENUHEIGHT_VALNAME, 18);
1087 ncm.iMenuWidth = get_reg_metric(hkey, METRICS_MENUWIDTH_VALNAME, ncm.iMenuHeight);
1089 /* menu font metrics */
1090 if (!reg_get_logfont(METRICS_REGKEY, METRICS_MENULOGFONT_VALNAME, &ncm.lfMenuFont))
1092 SystemParametersInfoW( SPI_GETICONTITLELOGFONT, 0, &ncm.lfMenuFont, 0 );
1093 GetProfileStringW( Desktop, MenuFont, ncm.lfCaptionFont.lfFaceName,
1094 ncm.lfMenuFont.lfFaceName, LF_FACESIZE );
1095 r = GetProfileIntW( Desktop, MenuFontSize, 0 );
1097 ncm.lfMenuFont.lfHeight = -r;
1098 ncm.lfMenuFont.lfWeight = FW_NORMAL;
1101 /* status bar font metrics */
1102 if (!reg_get_logfont(METRICS_REGKEY, METRICS_STATUSLOGFONT_VALNAME, &ncm.lfStatusFont))
1104 SystemParametersInfoW( SPI_GETICONTITLELOGFONT, 0, &ncm.lfStatusFont, 0 );
1105 GetProfileStringW( Desktop, StatusFont, ncm.lfCaptionFont.lfFaceName,
1106 ncm.lfStatusFont.lfFaceName, LF_FACESIZE );
1107 r = GetProfileIntW( Desktop, StatusFontSize, 0 );
1109 ncm.lfStatusFont.lfHeight = -r;
1110 ncm.lfStatusFont.lfWeight = FW_NORMAL;
1113 /* message font metrics */
1114 if (!reg_get_logfont(METRICS_REGKEY, METRICS_MESSAGELOGFONT_VALNAME, &ncm.lfMessageFont))
1116 SystemParametersInfoW( SPI_GETICONTITLELOGFONT, 0, &ncm.lfMessageFont, 0 );
1117 GetProfileStringW( Desktop, MessageFont, ncm.lfCaptionFont.lfFaceName,
1118 ncm.lfMessageFont.lfFaceName, LF_FACESIZE );
1119 r = GetProfileIntW( Desktop, MessageFontSize, 0 );
1121 ncm.lfMessageFont.lfHeight = -r;
1122 ncm.lfMessageFont.lfWeight = FW_NORMAL;
1125 /* some extra fields not in the nonclient structure */
1126 icon_size.cx = icon_size.cy = get_reg_metric( hkey, METRICS_ICONSIZE_VALNAME, 32 );
1128 if (hkey) RegCloseKey( hkey );
1129 normalize_nonclientmetrics( &ncm);
1130 memcpy( &nonclient_metrics, &ncm, sizeof(nonclient_metrics) );
1131 spi_loaded[SPI_NONCLIENTMETRICS_IDX] = TRUE;
1135 /***********************************************************************
1136 * SystemParametersInfoW (USER32.@)
1138 * Each system parameter has flag which shows whether the parameter
1139 * is loaded or not. Parameters, stored directly in SysParametersInfo are
1140 * loaded from registry only when they are requested and the flag is
1141 * "false", after the loading the flag is set to "true". On interprocess
1142 * notification of the parameter change the corresponding parameter flag is
1143 * set to "false". The parameter value will be reloaded when it is requested
1145 * Parameters, backed by or depend on GetSystemMetrics are processed
1146 * differently. These parameters are always loaded. They are reloaded right
1147 * away on interprocess change notification. We can't do lazy loading because
1148 * we don't want to complicate GetSystemMetrics.
1149 * Parameters, backed by X settings are read from corresponding setting.
1150 * On the parameter change request the setting is changed. Interprocess change
1151 * notifications are ignored.
1152 * When parameter value is updated the changed value is stored in permanent
1153 * registry branch if saving is requested. Otherwise it is stored
1154 * in temporary branch
1156 * Some SPI values can also be stored as Twips values in the registry,
1157 * don't forget the conversion!
1159 BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
1160 PVOID pvParam, UINT fWinIni )
1162 #define WINE_SPI_FIXME(x) \
1164 FIXME( "Unimplemented action: %u (%s)\n", x, #x ); \
1165 SetLastError( ERROR_INVALID_SPI_VALUE ); \
1168 #define WINE_SPI_WARN(x) \
1170 WARN( "Ignored action: %u (%s)\n", x, #x ); \
1174 unsigned spi_idx = 0;
1178 case SPI_GETBEEP: /* 1 */
1179 if (!pvParam) return FALSE;
1181 spi_idx = SPI_SETBEEP_IDX;
1182 if (!spi_loaded[spi_idx])
1186 if (SYSPARAMS_Load( SPI_SETBEEP_REGKEY, SPI_SETBEEP_VALNAME, buf, sizeof(buf) ))
1187 beep_active = !lstrcmpiW( Yes, buf );
1188 spi_loaded[spi_idx] = TRUE;
1191 *(BOOL *)pvParam = beep_active;
1194 case SPI_SETBEEP: /* 2 */
1195 spi_idx = SPI_SETBEEP_IDX;
1196 if (SYSPARAMS_Save( SPI_SETBEEP_REGKEY, SPI_SETBEEP_VALNAME,
1197 (uiParam ? Yes : No), fWinIni ))
1199 beep_active = uiParam;
1200 spi_loaded[spi_idx] = TRUE;
1206 case SPI_GETMOUSE: /* 3 */
1207 if (!pvParam) return FALSE;
1209 spi_idx = SPI_SETMOUSE_IDX;
1210 if (!spi_loaded[spi_idx])
1214 if (SYSPARAMS_Load( SPI_SETMOUSE_REGKEY, SPI_SETMOUSE_VALNAME1,
1216 mouse_threshold1 = atoiW( buf );
1217 if (SYSPARAMS_Load( SPI_SETMOUSE_REGKEY, SPI_SETMOUSE_VALNAME2,
1219 mouse_threshold2 = atoiW( buf );
1220 if (SYSPARAMS_Load( SPI_SETMOUSE_REGKEY, SPI_SETMOUSE_VALNAME3,
1222 mouse_speed = atoiW( buf );
1223 spi_loaded[spi_idx] = TRUE;
1225 ((INT *)pvParam)[0] = mouse_threshold1;
1226 ((INT *)pvParam)[1] = mouse_threshold2;
1227 ((INT *)pvParam)[2] = mouse_speed;
1230 case SPI_SETMOUSE: /* 4 */
1232 if (!pvParam) return FALSE;
1233 ret = set_int_param( SPI_SETMOUSE_IDX, SPI_SETMOUSE_REGKEY, SPI_SETMOUSE_VALNAME1,
1234 &mouse_threshold1, ((INT *)pvParam)[0], fWinIni);
1236 save_int_param( SPI_SETMOUSE_REGKEY, SPI_SETMOUSE_VALNAME2,
1237 &mouse_threshold2, ((INT *)pvParam)[1], fWinIni);
1238 save_int_param( SPI_SETMOUSE_REGKEY, SPI_SETMOUSE_VALNAME3,
1239 &mouse_speed, ((INT *)pvParam)[2], fWinIni);
1245 ret = get_twips_param( SPI_SETBORDER_IDX,
1246 SPI_SETBORDER_REGKEY,
1247 SPI_SETBORDER_VALNAME,
1249 if( *(INT*)pvParam < 1) *(INT*)pvParam = 1;
1253 nonclient_metrics.iBorderWidth = uiParam > 0 ? uiParam : 1;
1254 /* raw value goes to registry */
1255 ret = set_uint_param( SPI_SETBORDER_IDX,
1256 SPI_SETBORDER_REGKEY,
1257 SPI_SETBORDER_VALNAME,
1258 &border, uiParam, fWinIni );
1261 case SPI_GETKEYBOARDSPEED:
1262 ret = get_uint_param( SPI_SETKEYBOARDSPEED_IDX,
1263 SPI_SETKEYBOARDSPEED_REGKEY,
1264 SPI_SETKEYBOARDSPEED_VALNAME,
1265 &keyboard_speed, pvParam );
1268 case SPI_SETKEYBOARDSPEED:
1269 if (uiParam > 31) uiParam = 31;
1270 ret = set_uint_param( SPI_SETKEYBOARDSPEED_IDX,
1271 SPI_SETKEYBOARDSPEED_REGKEY,
1272 SPI_SETKEYBOARDSPEED_VALNAME,
1273 &keyboard_speed, uiParam, fWinIni );
1276 /* not implemented in Windows */
1277 WINE_SPI_WARN(SPI_LANGDRIVER); /* 12 */
1279 case SPI_ICONHORIZONTALSPACING:
1280 if (pvParam != NULL)
1282 ret = get_twips_param( SPI_ICONHORIZONTALSPACING_IDX,
1283 SPI_ICONHORIZONTALSPACING_REGKEY,
1284 SPI_ICONHORIZONTALSPACING_VALNAME,
1285 (UINT*)&icon_metrics.iHorzSpacing, pvParam );
1289 if (uiParam < 32) uiParam = 32;
1290 ret = set_uint_param( SPI_ICONHORIZONTALSPACING_IDX,
1291 SPI_ICONHORIZONTALSPACING_REGKEY,
1292 SPI_ICONHORIZONTALSPACING_VALNAME,
1293 (UINT*)&icon_metrics.iHorzSpacing, uiParam, fWinIni );
1297 case SPI_GETSCREENSAVETIMEOUT:
1298 ret = get_uint_param( SPI_SETSCREENSAVETIMEOUT_IDX,
1299 SPI_SETSCREENSAVETIMEOUT_REGKEY,
1300 SPI_SETSCREENSAVETIMEOUT_VALNAME,
1301 &screensave_timeout, pvParam );
1304 case SPI_SETSCREENSAVETIMEOUT:
1305 ret = set_uint_param( SPI_SETSCREENSAVETIMEOUT_IDX,
1306 SPI_SETSCREENSAVETIMEOUT_REGKEY,
1307 SPI_SETSCREENSAVETIMEOUT_VALNAME,
1308 &screensave_timeout, uiParam, fWinIni );
1311 case SPI_GETSCREENSAVEACTIVE: /* 16 */
1312 if (!pvParam) return FALSE;
1313 *(BOOL *)pvParam = USER_Driver->pGetScreenSaveActive();
1316 case SPI_SETSCREENSAVEACTIVE: /* 17 */
1320 wsprintfW(buf, CSu, uiParam);
1321 USER_Driver->pSetScreenSaveActive( uiParam );
1322 /* saved value does not affect Wine */
1323 SYSPARAMS_Save( SPI_SETSCREENSAVEACTIVE_REGKEY,
1324 SPI_SETSCREENSAVEACTIVE_VALNAME,
1329 case SPI_GETGRIDGRANULARITY:
1330 ret = get_uint_param( SPI_SETGRIDGRANULARITY_IDX,
1331 SPI_SETGRIDGRANULARITY_REGKEY,
1332 SPI_SETGRIDGRANULARITY_VALNAME,
1333 &grid_granularity, pvParam );
1336 case SPI_SETGRIDGRANULARITY:
1337 ret = set_uint_param( SPI_SETGRIDGRANULARITY_IDX,
1338 SPI_SETGRIDGRANULARITY_REGKEY,
1339 SPI_SETGRIDGRANULARITY_VALNAME,
1340 &grid_granularity, uiParam, fWinIni );
1343 case SPI_SETDESKWALLPAPER: /* 20 */
1344 if (!pvParam || !SetDeskWallPaper( (LPSTR)pvParam )) return FALSE;
1345 SYSPARAMS_Save(SPI_SETDESKWALLPAPER_REGKEY, SPI_SETDESKWALLPAPER_VALNAME, pvParam, fWinIni);
1348 case SPI_SETDESKPATTERN: /* 21 */
1349 /* FIXME: the ability to specify a pattern in pvParam
1350 doesn't seem to be documented for Win32 */
1351 if ((INT16)uiParam == -1)
1354 GetProfileStringW( Desktop, Pattern,
1356 buf, sizeof(buf)/sizeof(WCHAR) );
1357 ret = DESKTOP_SetPattern( buf );
1359 ret = DESKTOP_SetPattern( (LPWSTR)pvParam );
1362 case SPI_GETKEYBOARDDELAY:
1363 ret = get_uint_param( SPI_SETKEYBOARDDELAY_IDX,
1364 SPI_SETKEYBOARDDELAY_REGKEY,
1365 SPI_SETKEYBOARDDELAY_VALNAME,
1366 &keyboard_delay, pvParam );
1369 case SPI_SETKEYBOARDDELAY:
1370 ret = set_uint_param( SPI_SETKEYBOARDDELAY_IDX,
1371 SPI_SETKEYBOARDDELAY_REGKEY,
1372 SPI_SETKEYBOARDDELAY_VALNAME,
1373 &keyboard_delay, uiParam, fWinIni );
1376 case SPI_ICONVERTICALSPACING:
1377 if (pvParam != NULL)
1379 ret = get_twips_param( SPI_ICONVERTICALSPACING_IDX,
1380 SPI_ICONVERTICALSPACING_REGKEY,
1381 SPI_ICONVERTICALSPACING_VALNAME,
1382 (UINT*)&icon_metrics.iVertSpacing, pvParam );
1383 if( icon_metrics.iVertSpacing < 32)
1384 icon_metrics.iVertSpacing = 32;
1388 if (uiParam < 32) uiParam = 32;
1389 ret = set_uint_param( SPI_ICONVERTICALSPACING_IDX,
1390 SPI_ICONVERTICALSPACING_REGKEY,
1391 SPI_ICONVERTICALSPACING_VALNAME,
1392 (UINT*)&icon_metrics.iVertSpacing, uiParam, fWinIni );
1396 case SPI_GETICONTITLEWRAP:
1397 ret = get_bool_param( SPI_SETICONTITLEWRAP_IDX,
1398 SPI_SETICONTITLEWRAP_REGKEY1,
1399 SPI_SETICONTITLEWRAP_VALNAME,
1400 &icon_metrics.iTitleWrap, pvParam );
1403 case SPI_SETICONTITLEWRAP:
1404 ret = set_bool_param_mirrored( SPI_SETICONTITLEWRAP_IDX,
1405 SPI_SETICONTITLEWRAP_REGKEY1,
1406 SPI_SETICONTITLEWRAP_REGKEY2,
1407 SPI_SETICONTITLEWRAP_VALNAME,
1408 &icon_metrics.iTitleWrap, uiParam, fWinIni );
1411 case SPI_GETMENUDROPALIGNMENT:
1412 ret = get_uint_param( SPI_SETMENUDROPALIGNMENT_IDX,
1413 SPI_SETMENUDROPALIGNMENT_REGKEY1,
1414 SPI_SETMENUDROPALIGNMENT_VALNAME,
1415 &menu_drop_alignment, pvParam );
1418 case SPI_SETMENUDROPALIGNMENT:
1419 ret = set_uint_param_mirrored( SPI_SETMENUDROPALIGNMENT_IDX,
1420 SPI_SETMENUDROPALIGNMENT_REGKEY1,
1421 SPI_SETMENUDROPALIGNMENT_REGKEY2,
1422 SPI_SETMENUDROPALIGNMENT_VALNAME,
1423 &menu_drop_alignment, uiParam, fWinIni );
1426 case SPI_SETDOUBLECLKWIDTH:
1427 ret = set_uint_param_mirrored( SPI_SETDOUBLECLKWIDTH_IDX,
1428 SPI_SETDOUBLECLKWIDTH_REGKEY1,
1429 SPI_SETDOUBLECLKWIDTH_REGKEY2,
1430 SPI_SETDOUBLECLKWIDTH_VALNAME,
1431 &double_click_width, uiParam, fWinIni );
1434 case SPI_SETDOUBLECLKHEIGHT:
1435 ret = set_uint_param_mirrored( SPI_SETDOUBLECLKHEIGHT_IDX,
1436 SPI_SETDOUBLECLKHEIGHT_REGKEY1,
1437 SPI_SETDOUBLECLKHEIGHT_REGKEY2,
1438 SPI_SETDOUBLECLKHEIGHT_VALNAME,
1439 &double_click_height, uiParam, fWinIni );
1442 case SPI_GETICONTITLELOGFONT:
1446 if (!pvParam) return FALSE;
1448 spi_idx = SPI_SETICONTITLELOGFONT_IDX;
1449 if (!spi_loaded[spi_idx])
1451 if (!reg_get_logfont( SPI_SETICONTITLELOGFONT_REGKEY,
1452 SPI_SETICONTITLELOGFONT_VALNAME, &icon_metrics.lfFont ))
1457 * The 'default GDI fonts' seems to be returned.
1458 * If a returned font is not a correct font in your environment,
1459 * please try to fix objects/gdiobj.c at first.
1461 GetObjectW( GetStockObject( DEFAULT_GUI_FONT ), sizeof(LOGFONTW), &lfDefault );
1463 GetProfileStringW( Desktop, IconTitleFaceName,
1464 lfDefault.lfFaceName,
1465 icon_metrics.lfFont.lfFaceName,
1468 r = GetProfileIntW( Desktop, IconTitleSize, 0 );
1470 icon_metrics.lfFont.lfHeight = -r;
1472 icon_metrics.lfFont.lfHeight = lfDefault.lfHeight;
1474 icon_metrics.lfFont.lfWidth = 0;
1475 icon_metrics.lfFont.lfEscapement = icon_metrics.lfFont.lfOrientation = 0;
1476 icon_metrics.lfFont.lfWeight = FW_NORMAL;
1477 icon_metrics.lfFont.lfItalic = FALSE;
1478 icon_metrics.lfFont.lfStrikeOut = FALSE;
1479 icon_metrics.lfFont.lfUnderline = FALSE;
1480 icon_metrics.lfFont.lfCharSet = lfDefault.lfCharSet; /* at least 'charset' should not be hard-coded */
1481 icon_metrics.lfFont.lfOutPrecision = OUT_DEFAULT_PRECIS;
1482 icon_metrics.lfFont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
1483 icon_metrics.lfFont.lfQuality = DEFAULT_QUALITY;
1484 icon_metrics.lfFont.lfPitchAndFamily = DEFAULT_PITCH;
1485 spi_loaded[spi_idx] = TRUE;
1488 *(LOGFONTW *)pvParam = icon_metrics.lfFont;
1492 case SPI_SETDOUBLECLICKTIME:
1493 ret = set_uint_param( SPI_SETDOUBLECLICKTIME_IDX,
1494 SPI_SETDOUBLECLICKTIME_REGKEY,
1495 SPI_SETDOUBLECLICKTIME_VALNAME,
1496 &double_click_time, uiParam, fWinIni );
1499 case SPI_SETMOUSEBUTTONSWAP:
1500 ret = set_bool_param( SPI_SETMOUSEBUTTONSWAP_IDX,
1501 SPI_SETMOUSEBUTTONSWAP_REGKEY,
1502 SPI_SETMOUSEBUTTONSWAP_VALNAME,
1503 &swap_buttons, uiParam, fWinIni );
1506 case SPI_SETICONTITLELOGFONT: /* 34 */
1507 if( uiParam == sizeof(LOGFONTW)) {
1508 ret = SYSPARAMS_SaveLogFont( SPI_SETICONTITLELOGFONT_REGKEY,
1509 SPI_SETICONTITLELOGFONT_VALNAME, (LOGFONTW *)pvParam, fWinIni);
1511 icon_metrics.lfFont = *(LOGFONTW *)pvParam;
1512 spi_loaded[SPI_SETICONTITLELOGFONT_IDX] = TRUE;
1518 case SPI_GETFASTTASKSWITCH: /* 35 */
1519 if (!pvParam) return FALSE;
1520 *(BOOL *)pvParam = 1;
1523 case SPI_SETFASTTASKSWITCH: /* 36 */
1524 /* the action is disabled */
1528 case SPI_SETDRAGFULLWINDOWS:
1529 ret = set_bool_param( SPI_SETDRAGFULLWINDOWS_IDX,
1530 SPI_SETDRAGFULLWINDOWS_REGKEY,
1531 SPI_SETDRAGFULLWINDOWS_VALNAME,
1532 &drag_full_windows, uiParam, fWinIni );
1535 case SPI_GETDRAGFULLWINDOWS:
1536 ret = get_bool_param( SPI_SETDRAGFULLWINDOWS_IDX,
1537 SPI_SETDRAGFULLWINDOWS_REGKEY,
1538 SPI_SETDRAGFULLWINDOWS_VALNAME,
1539 &drag_full_windows, pvParam );
1542 case SPI_GETNONCLIENTMETRICS:
1544 LPNONCLIENTMETRICSW lpnm = pvParam;
1546 if (!spi_loaded[SPI_NONCLIENTMETRICS_IDX]) load_nonclient_metrics();
1548 if (lpnm && lpnm->cbSize == sizeof(NONCLIENTMETRICSW))
1549 memcpy( lpnm, &nonclient_metrics, sizeof(*lpnm) );
1555 case SPI_SETNONCLIENTMETRICS:
1557 LPNONCLIENTMETRICSW lpnm = pvParam;
1559 if (lpnm && lpnm->cbSize == sizeof(NONCLIENTMETRICSW))
1561 NONCLIENTMETRICSW ncm;
1562 ret = set_uint_param( SPI_SETBORDER_IDX,
1563 SPI_SETBORDER_REGKEY, SPI_SETBORDER_VALNAME,
1564 &border, lpnm->iBorderWidth, fWinIni );
1565 if( ret) ret = save_int_param( METRICS_REGKEY,
1566 METRICS_SCROLLWIDTH_VALNAME, NULL,
1567 lpnm->iScrollWidth, fWinIni );
1568 if( ret) ret = save_int_param( METRICS_REGKEY,
1569 METRICS_SCROLLHEIGHT_VALNAME, NULL,
1570 lpnm->iScrollHeight, fWinIni );
1571 if( ret) ret = save_int_param( METRICS_REGKEY,
1572 METRICS_CAPTIONWIDTH_VALNAME, NULL,
1573 lpnm->iCaptionWidth, fWinIni );
1574 if( ret) ret = save_int_param( METRICS_REGKEY,
1575 METRICS_CAPTIONHEIGHT_VALNAME, NULL,
1576 lpnm->iCaptionHeight, fWinIni );
1577 if( ret) ret = save_int_param( METRICS_REGKEY,
1578 METRICS_SMCAPTIONWIDTH_VALNAME, NULL,
1579 lpnm->iSmCaptionWidth, fWinIni );
1580 if( ret) ret = save_int_param( METRICS_REGKEY,
1581 METRICS_SMCAPTIONHEIGHT_VALNAME, NULL,
1582 lpnm->iSmCaptionHeight, fWinIni );
1583 if( ret) ret = save_int_param( METRICS_REGKEY,
1584 METRICS_MENUWIDTH_VALNAME, NULL,
1585 lpnm->iMenuWidth, fWinIni );
1586 if( ret) ret = save_int_param( METRICS_REGKEY,
1587 METRICS_MENUHEIGHT_VALNAME, NULL,
1588 lpnm->iMenuHeight, fWinIni );
1589 if( ret) ret = SYSPARAMS_SaveLogFont(
1590 METRICS_REGKEY, METRICS_MENULOGFONT_VALNAME,
1591 &lpnm->lfMenuFont, fWinIni);
1592 if( ret) ret = SYSPARAMS_SaveLogFont(
1593 METRICS_REGKEY, METRICS_CAPTIONLOGFONT_VALNAME,
1594 &lpnm->lfCaptionFont, fWinIni);
1595 if( ret) ret = SYSPARAMS_SaveLogFont(
1596 METRICS_REGKEY, METRICS_SMCAPTIONLOGFONT_VALNAME,
1597 &lpnm->lfSmCaptionFont, fWinIni);
1598 if( ret) ret = SYSPARAMS_SaveLogFont(
1599 METRICS_REGKEY, METRICS_STATUSLOGFONT_VALNAME,
1600 &lpnm->lfStatusFont, fWinIni);
1601 if( ret) ret = SYSPARAMS_SaveLogFont(
1602 METRICS_REGKEY, METRICS_MESSAGELOGFONT_VALNAME,
1603 &lpnm->lfMessageFont, fWinIni);
1605 memcpy( &ncm, lpnm, sizeof(nonclient_metrics) );
1606 normalize_nonclientmetrics( &ncm);
1607 memcpy( &nonclient_metrics, &ncm, sizeof(nonclient_metrics) );
1608 spi_loaded[SPI_NONCLIENTMETRICS_IDX] = TRUE;
1614 case SPI_GETMINIMIZEDMETRICS:
1616 MINIMIZEDMETRICS * lpMm = pvParam;
1617 if (lpMm && lpMm->cbSize == sizeof(*lpMm)) {
1618 if( spi_loaded[SPI_MINIMIZEDMETRICS_IDX]) load_minimized_metrics();
1619 memcpy( lpMm, &minimized_metrics, sizeof(*lpMm) );
1625 case SPI_SETMINIMIZEDMETRICS:
1627 MINIMIZEDMETRICS * lpMm = pvParam;
1628 if (lpMm && lpMm->cbSize == sizeof(*lpMm)) {
1629 ret = save_int_param( METRICS_REGKEY, METRICS_MINWIDTH_VALNAME,
1630 &minimized_metrics.iWidth, max( lpMm->iWidth, 0), fWinIni);
1631 if( ret) ret = save_int_param( METRICS_REGKEY,
1632 METRICS_MINHORZGAP_VALNAME, &minimized_metrics.iHorzGap,
1633 max( lpMm->iHorzGap, 0), fWinIni);
1634 if( ret) ret = save_int_param( METRICS_REGKEY,
1635 METRICS_MINVERTGAP_VALNAME, &minimized_metrics.iVertGap,
1636 max( lpMm->iVertGap, 0), fWinIni);
1637 if( ret) ret = save_int_param( METRICS_REGKEY,
1638 METRICS_MINARRANGE_VALNAME, &minimized_metrics.iArrange,
1639 0x0f & lpMm->iArrange, fWinIni);
1640 if( ret) spi_loaded[SPI_MINIMIZEDMETRICS_IDX] = TRUE;
1646 case SPI_GETICONMETRICS:
1648 LPICONMETRICSW lpIcon = pvParam;
1649 if(lpIcon && lpIcon->cbSize == sizeof(*lpIcon))
1651 SystemParametersInfoW( SPI_ICONHORIZONTALSPACING, 0,
1652 &lpIcon->iHorzSpacing, FALSE );
1653 SystemParametersInfoW( SPI_ICONVERTICALSPACING, 0,
1654 &lpIcon->iVertSpacing, FALSE );
1655 SystemParametersInfoW( SPI_GETICONTITLEWRAP, 0,
1656 &lpIcon->iTitleWrap, FALSE );
1657 SystemParametersInfoW( SPI_GETICONTITLELOGFONT, 0,
1658 &lpIcon->lfFont, FALSE );
1667 case SPI_SETICONMETRICS:
1669 LPICONMETRICSW lpIcon = pvParam;
1670 if (lpIcon && lpIcon->cbSize == sizeof(*lpIcon)) {
1671 ret = set_int_param( SPI_ICONVERTICALSPACING_IDX,
1672 SPI_ICONVERTICALSPACING_REGKEY,
1673 SPI_ICONVERTICALSPACING_VALNAME,
1674 &icon_metrics.iVertSpacing,
1675 lpIcon->iVertSpacing, fWinIni);
1677 ret = set_int_param( SPI_ICONHORIZONTALSPACING_IDX,
1678 SPI_ICONHORIZONTALSPACING_REGKEY,
1679 SPI_ICONHORIZONTALSPACING_VALNAME,
1680 &icon_metrics.iHorzSpacing,
1681 lpIcon->iHorzSpacing, fWinIni );
1684 ret = set_bool_param_mirrored( SPI_SETICONTITLEWRAP_IDX,
1685 SPI_SETICONTITLEWRAP_REGKEY1, SPI_SETICONTITLEWRAP_REGKEY2,
1686 SPI_SETICONTITLEWRAP_VALNAME, &icon_metrics.iTitleWrap,
1687 lpIcon->iTitleWrap, fWinIni );
1689 if( ret) ret = SYSPARAMS_SaveLogFont( SPI_SETICONTITLELOGFONT_REGKEY,
1690 SPI_SETICONTITLELOGFONT_VALNAME, &lpIcon->lfFont, fWinIni);
1692 icon_metrics.lfFont = lpIcon->lfFont;
1693 spi_loaded[SPI_SETICONTITLELOGFONT_IDX] = TRUE;
1700 case SPI_SETWORKAREA: /* 47 WINVER >= 0x400 */
1702 if (!pvParam) return FALSE;
1704 spi_idx = SPI_SETWORKAREA_IDX;
1705 CopyRect( &work_area, (RECT *)pvParam );
1706 spi_loaded[spi_idx] = TRUE;
1710 case SPI_GETWORKAREA: /* 48 WINVER >= 0x400 */
1712 if (!pvParam) return FALSE;
1714 spi_idx = SPI_SETWORKAREA_IDX;
1715 if (!spi_loaded[spi_idx])
1717 SetRect( &work_area, 0, 0,
1718 GetSystemMetrics( SM_CXSCREEN ),
1719 GetSystemMetrics( SM_CYSCREEN ) );
1720 spi_loaded[spi_idx] = TRUE;
1722 CopyRect( (RECT *)pvParam, &work_area );
1727 WINE_SPI_FIXME(SPI_SETPENWINDOWS); /* 49 WINVER >= 0x400 */
1729 case SPI_GETFILTERKEYS: /* 50 */
1731 LPFILTERKEYS lpFilterKeys = (LPFILTERKEYS)pvParam;
1732 WARN("SPI_GETFILTERKEYS not fully implemented\n");
1733 if (lpFilterKeys && lpFilterKeys->cbSize == sizeof(FILTERKEYS))
1735 /* Indicate that no FilterKeys feature available */
1736 lpFilterKeys->dwFlags = 0;
1737 lpFilterKeys->iWaitMSec = 0;
1738 lpFilterKeys->iDelayMSec = 0;
1739 lpFilterKeys->iRepeatMSec = 0;
1740 lpFilterKeys->iBounceMSec = 0;
1748 WINE_SPI_FIXME(SPI_SETFILTERKEYS); /* 51 */
1750 case SPI_GETTOGGLEKEYS: /* 52 */
1752 LPTOGGLEKEYS lpToggleKeys = (LPTOGGLEKEYS)pvParam;
1753 WARN("SPI_GETTOGGLEKEYS not fully implemented\n");
1754 if (lpToggleKeys && lpToggleKeys->cbSize == sizeof(TOGGLEKEYS))
1756 /* Indicate that no ToggleKeys feature available */
1757 lpToggleKeys->dwFlags = 0;
1765 WINE_SPI_FIXME(SPI_SETTOGGLEKEYS); /* 53 */
1767 case SPI_GETMOUSEKEYS: /* 54 */
1769 LPMOUSEKEYS lpMouseKeys = (LPMOUSEKEYS)pvParam;
1770 WARN("SPI_GETMOUSEKEYS not fully implemented\n");
1771 if (lpMouseKeys && lpMouseKeys->cbSize == sizeof(MOUSEKEYS))
1773 /* Indicate that no MouseKeys feature available */
1774 lpMouseKeys->dwFlags = 0;
1775 lpMouseKeys->iMaxSpeed = 360;
1776 lpMouseKeys->iTimeToMaxSpeed = 1000;
1777 lpMouseKeys->iCtrlSpeed = 0;
1778 lpMouseKeys->dwReserved1 = 0;
1779 lpMouseKeys->dwReserved2 = 0;
1787 WINE_SPI_FIXME(SPI_SETMOUSEKEYS); /* 55 */
1789 case SPI_GETSHOWSOUNDS:
1790 ret = get_bool_param( SPI_SETSHOWSOUNDS_IDX,
1791 SPI_SETSHOWSOUNDS_REGKEY,
1792 SPI_SETSHOWSOUNDS_VALNAME,
1793 &show_sounds, pvParam );
1796 case SPI_SETSHOWSOUNDS:
1797 ret = set_bool_param( SPI_SETSHOWSOUNDS_IDX,
1798 SPI_SETSHOWSOUNDS_REGKEY,
1799 SPI_SETSHOWSOUNDS_VALNAME,
1800 &show_sounds, uiParam, fWinIni );
1803 case SPI_GETSTICKYKEYS: /* 58 */
1805 LPSTICKYKEYS lpStickyKeys = (LPSTICKYKEYS)pvParam;
1806 WARN("SPI_GETSTICKYKEYS not fully implemented\n");
1807 if (lpStickyKeys && lpStickyKeys->cbSize == sizeof(STICKYKEYS))
1809 /* Indicate that no StickyKeys feature available */
1810 lpStickyKeys->dwFlags = 0;
1818 WINE_SPI_FIXME(SPI_SETSTICKYKEYS); /* 59 */
1820 case SPI_GETACCESSTIMEOUT: /* 60 */
1822 LPACCESSTIMEOUT lpAccessTimeout = (LPACCESSTIMEOUT)pvParam;
1823 WARN("SPI_GETACCESSTIMEOUT not fully implemented\n");
1824 if (lpAccessTimeout && lpAccessTimeout->cbSize == sizeof(ACCESSTIMEOUT))
1826 /* Indicate that no accessibility features timeout is available */
1827 lpAccessTimeout->dwFlags = 0;
1828 lpAccessTimeout->iTimeOutMSec = 0;
1836 WINE_SPI_FIXME(SPI_SETACCESSTIMEOUT); /* 61 */
1838 case SPI_GETSERIALKEYS: /* 62 WINVER >= 0x400 */
1840 LPSERIALKEYSW lpSerialKeysW = (LPSERIALKEYSW)pvParam;
1841 WARN("SPI_GETSERIALKEYS not fully implemented\n");
1842 if (lpSerialKeysW && lpSerialKeysW->cbSize == sizeof(SERIALKEYSW))
1844 /* Indicate that no SerialKeys feature available */
1845 lpSerialKeysW->dwFlags = 0;
1846 lpSerialKeysW->lpszActivePort = NULL;
1847 lpSerialKeysW->lpszPort = NULL;
1848 lpSerialKeysW->iBaudRate = 0;
1849 lpSerialKeysW->iPortState = 0;
1857 WINE_SPI_FIXME(SPI_SETSERIALKEYS); /* 63 WINVER >= 0x400 */
1859 case SPI_GETSOUNDSENTRY: /* 64 */
1861 LPSOUNDSENTRYW lpSoundSentryW = (LPSOUNDSENTRYW)pvParam;
1862 WARN("SPI_GETSOUNDSENTRY not fully implemented\n");
1863 if (lpSoundSentryW && lpSoundSentryW->cbSize == sizeof(SOUNDSENTRYW))
1865 /* Indicate that no SoundSentry feature available */
1866 lpSoundSentryW->dwFlags = 0;
1867 lpSoundSentryW->iFSTextEffect = 0;
1868 lpSoundSentryW->iFSTextEffectMSec = 0;
1869 lpSoundSentryW->iFSTextEffectColorBits = 0;
1870 lpSoundSentryW->iFSGrafEffect = 0;
1871 lpSoundSentryW->iFSGrafEffectMSec = 0;
1872 lpSoundSentryW->iFSGrafEffectColor = 0;
1873 lpSoundSentryW->iWindowsEffect = 0;
1874 lpSoundSentryW->iWindowsEffectMSec = 0;
1875 lpSoundSentryW->lpszWindowsEffectDLL = 0;
1876 lpSoundSentryW->iWindowsEffectOrdinal = 0;
1884 WINE_SPI_FIXME(SPI_SETSOUNDSENTRY); /* 65 */
1886 case SPI_GETHIGHCONTRAST: /* 66 WINVER >= 0x400 */
1888 LPHIGHCONTRASTW lpHighContrastW = (LPHIGHCONTRASTW)pvParam;
1889 WARN("SPI_GETHIGHCONTRAST not fully implemented\n");
1890 if (lpHighContrastW && lpHighContrastW->cbSize == sizeof(HIGHCONTRASTW))
1892 /* Indicate that no high contrast feature available */
1893 lpHighContrastW->dwFlags = 0;
1894 lpHighContrastW->lpszDefaultScheme = NULL;
1902 WINE_SPI_FIXME(SPI_SETHIGHCONTRAST); /* 67 WINVER >= 0x400 */
1904 case SPI_GETKEYBOARDPREF:
1905 ret = get_bool_param( SPI_SETKEYBOARDPREF_IDX,
1906 SPI_SETKEYBOARDPREF_REGKEY,
1907 SPI_SETKEYBOARDPREF_VALNAME,
1908 &keyboard_pref, pvParam );
1911 case SPI_SETKEYBOARDPREF:
1912 ret = set_bool_param( SPI_SETKEYBOARDPREF_IDX,
1913 SPI_SETKEYBOARDPREF_REGKEY,
1914 SPI_SETKEYBOARDPREF_VALNAME,
1915 &keyboard_pref, uiParam, fWinIni );
1918 case SPI_GETSCREENREADER:
1919 ret = get_bool_param( SPI_SETSCREENREADER_IDX,
1920 SPI_SETSCREENREADER_REGKEY,
1921 SPI_SETSCREENREADER_VALNAME,
1922 &screen_reader, pvParam );
1925 case SPI_SETSCREENREADER:
1926 ret = set_bool_param( SPI_SETSCREENREADER_IDX,
1927 SPI_SETSCREENREADER_REGKEY,
1928 SPI_SETSCREENREADER_VALNAME,
1929 &screen_reader, uiParam, fWinIni );
1932 case SPI_GETANIMATION: /* 72 WINVER >= 0x400 */
1934 LPANIMATIONINFO lpAnimInfo = (LPANIMATIONINFO)pvParam;
1936 /* Tell it "disabled" */
1937 if (lpAnimInfo && lpAnimInfo->cbSize == sizeof(ANIMATIONINFO))
1938 lpAnimInfo->iMinAnimate = 0; /* Minimise and restore animation is disabled (nonzero == enabled) */
1943 WINE_SPI_WARN(SPI_SETANIMATION); /* 73 WINVER >= 0x400 */
1945 case SPI_GETFONTSMOOTHING:
1948 ret = get_uint_param( SPI_SETFONTSMOOTHING_IDX,
1949 SPI_SETFONTSMOOTHING_REGKEY,
1950 SPI_SETFONTSMOOTHING_VALNAME,
1951 &font_smoothing, &tmpval );
1952 *(UINT *) pvParam = ( tmpval != 0);
1955 case SPI_SETFONTSMOOTHING:
1956 uiParam = uiParam ? 2 : 0; /* Win NT4/2k/XP behavior */
1957 ret = set_uint_param( SPI_SETFONTSMOOTHING_IDX,
1958 SPI_SETFONTSMOOTHING_REGKEY,
1959 SPI_SETFONTSMOOTHING_VALNAME,
1960 &font_smoothing, uiParam, fWinIni );
1963 WINE_SPI_FIXME(SPI_SETDRAGWIDTH); /* 76 WINVER >= 0x400 */
1964 WINE_SPI_FIXME(SPI_SETDRAGHEIGHT); /* 77 WINVER >= 0x400 */
1966 WINE_SPI_FIXME(SPI_SETHANDHELD); /* 78 WINVER >= 0x400 */
1968 WINE_SPI_FIXME(SPI_GETLOWPOWERTIMEOUT); /* 79 WINVER >= 0x400 */
1969 WINE_SPI_FIXME(SPI_GETPOWEROFFTIMEOUT); /* 80 WINVER >= 0x400 */
1970 WINE_SPI_FIXME(SPI_SETLOWPOWERTIMEOUT); /* 81 WINVER >= 0x400 */
1971 WINE_SPI_FIXME(SPI_SETPOWEROFFTIMEOUT); /* 82 WINVER >= 0x400 */
1973 case SPI_GETLOWPOWERACTIVE:
1974 ret = get_bool_param( SPI_SETLOWPOWERACTIVE_IDX,
1975 SPI_SETLOWPOWERACTIVE_REGKEY,
1976 SPI_SETLOWPOWERACTIVE_VALNAME,
1977 &lowpoweractive, pvParam );
1980 case SPI_GETPOWEROFFACTIVE:
1981 ret = get_bool_param( SPI_SETPOWEROFFACTIVE_IDX,
1982 SPI_SETPOWEROFFACTIVE_REGKEY,
1983 SPI_SETPOWEROFFACTIVE_VALNAME,
1984 &poweroffactive, pvParam );
1987 case SPI_SETLOWPOWERACTIVE:
1988 ret = set_bool_param( SPI_SETLOWPOWERACTIVE_IDX,
1989 SPI_SETLOWPOWERACTIVE_REGKEY,
1990 SPI_SETLOWPOWERACTIVE_VALNAME,
1991 &lowpoweractive, uiParam, fWinIni );
1994 case SPI_SETPOWEROFFACTIVE:
1995 ret = set_bool_param( SPI_SETPOWEROFFACTIVE_IDX,
1996 SPI_SETPOWEROFFACTIVE_REGKEY,
1997 SPI_SETPOWEROFFACTIVE_VALNAME,
1998 &poweroffactive, uiParam, fWinIni );
2001 WINE_SPI_FIXME(SPI_SETCURSORS); /* 87 WINVER >= 0x400 */
2002 WINE_SPI_FIXME(SPI_SETICONS); /* 88 WINVER >= 0x400 */
2004 case SPI_GETDEFAULTINPUTLANG: /* 89 WINVER >= 0x400 */
2005 ret = GetKeyboardLayout(0) ? TRUE : FALSE;
2008 WINE_SPI_FIXME(SPI_SETDEFAULTINPUTLANG); /* 90 WINVER >= 0x400 */
2010 WINE_SPI_FIXME(SPI_SETLANGTOGGLE); /* 91 WINVER >= 0x400 */
2012 case SPI_GETWINDOWSEXTENSION: /* 92 WINVER >= 0x400 */
2013 WARN("pretend no support for Win9x Plus! for now.\n");
2014 ret = FALSE; /* yes, this is the result value */
2017 WINE_SPI_FIXME(SPI_SETMOUSETRAILS); /* 93 WINVER >= 0x400 */
2018 WINE_SPI_FIXME(SPI_GETMOUSETRAILS); /* 94 WINVER >= 0x400 */
2019 WINE_SPI_FIXME(SPI_GETSNAPTODEFBUTTON); /* 95 WINVER >= 0x400 */
2020 WINE_SPI_FIXME(SPI_SETSNAPTODEFBUTTON); /* 96 WINVER >= 0x400 */
2022 case SPI_SETSCREENSAVERRUNNING:
2023 ret = set_bool_param( SPI_SETSCREENSAVERRUNNING_IDX,
2024 SPI_SETSCREENSAVERRUNNING_REGKEY,
2025 SPI_SETSCREENSAVERRUNNING_VALNAME,
2026 &screensaver_running, uiParam, fWinIni );
2029 case SPI_GETMOUSEHOVERWIDTH:
2030 ret = get_uint_param( SPI_SETMOUSEHOVERWIDTH_IDX,
2031 SPI_SETMOUSEHOVERWIDTH_REGKEY,
2032 SPI_SETMOUSEHOVERWIDTH_VALNAME,
2033 &mouse_hover_width, pvParam );
2036 case SPI_SETMOUSEHOVERWIDTH:
2037 ret = set_uint_param( SPI_SETMOUSEHOVERWIDTH_IDX,
2038 SPI_SETMOUSEHOVERWIDTH_REGKEY,
2039 SPI_SETMOUSEHOVERWIDTH_VALNAME,
2040 &mouse_hover_width, uiParam, fWinIni );
2043 case SPI_GETMOUSEHOVERHEIGHT:
2044 ret = get_uint_param( SPI_SETMOUSEHOVERHEIGHT_IDX,
2045 SPI_SETMOUSEHOVERHEIGHT_REGKEY,
2046 SPI_SETMOUSEHOVERHEIGHT_VALNAME,
2047 &mouse_hover_height, pvParam );
2050 case SPI_SETMOUSEHOVERHEIGHT:
2051 ret = set_uint_param( SPI_SETMOUSEHOVERHEIGHT_IDX,
2052 SPI_SETMOUSEHOVERHEIGHT_REGKEY,
2053 SPI_SETMOUSEHOVERHEIGHT_VALNAME,
2054 &mouse_hover_height, uiParam, fWinIni );
2057 case SPI_GETMOUSEHOVERTIME:
2058 ret = get_uint_param( SPI_SETMOUSEHOVERTIME_IDX,
2059 SPI_SETMOUSEHOVERTIME_REGKEY,
2060 SPI_SETMOUSEHOVERTIME_VALNAME,
2061 &mouse_hover_time, pvParam );
2064 case SPI_SETMOUSEHOVERTIME:
2065 ret = set_uint_param( SPI_SETMOUSEHOVERTIME_IDX,
2066 SPI_SETMOUSEHOVERTIME_REGKEY,
2067 SPI_SETMOUSEHOVERTIME_VALNAME,
2068 &mouse_hover_time, uiParam, fWinIni );
2071 case SPI_GETWHEELSCROLLLINES:
2072 ret = get_uint_param( SPI_SETMOUSESCROLLLINES_IDX,
2073 SPI_SETMOUSESCROLLLINES_REGKEY,
2074 SPI_SETMOUSESCROLLLINES_VALNAME,
2075 &mouse_scroll_lines, pvParam );
2078 case SPI_SETWHEELSCROLLLINES:
2079 ret = set_uint_param( SPI_SETMOUSESCROLLLINES_IDX,
2080 SPI_SETMOUSESCROLLLINES_REGKEY,
2081 SPI_SETMOUSESCROLLLINES_VALNAME,
2082 &mouse_scroll_lines, uiParam, fWinIni );
2085 case SPI_GETMENUSHOWDELAY:
2086 ret = get_uint_param( SPI_SETMENUSHOWDELAY_IDX,
2087 SPI_SETMENUSHOWDELAY_REGKEY,
2088 SPI_SETMENUSHOWDELAY_VALNAME,
2089 &menu_show_delay, pvParam );
2092 case SPI_SETMENUSHOWDELAY:
2093 ret = set_uint_param( SPI_SETMENUSHOWDELAY_IDX,
2094 SPI_SETMENUSHOWDELAY_REGKEY,
2095 SPI_SETMENUSHOWDELAY_VALNAME,
2096 &menu_show_delay, uiParam, fWinIni );
2099 WINE_SPI_FIXME(SPI_GETSHOWIMEUI); /* 110 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
2100 WINE_SPI_FIXME(SPI_SETSHOWIMEUI); /* 111 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
2102 case SPI_GETMOUSESPEED: /* 112 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2105 ret = SystemParametersInfoW (SPI_GETMOUSE, 0, buf, fWinIni);
2106 *(INT *)pvParam = buf[2];
2110 WINE_SPI_FIXME(SPI_SETMOUSESPEED); /* 113 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2112 case SPI_GETSCREENSAVERRUNNING:
2113 ret = get_bool_param( SPI_SETSCREENSAVERRUNNING_IDX,
2114 SPI_SETSCREENSAVERRUNNING_REGKEY,
2115 SPI_SETSCREENSAVERRUNNING_VALNAME,
2116 &screensaver_running, pvParam );
2119 case SPI_GETDESKWALLPAPER: /* 115 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2121 WCHAR buf[MAX_PATH];
2123 if (!pvParam) return FALSE;
2125 if (uiParam > MAX_PATH)
2130 if (SYSPARAMS_Load(SPI_SETDESKWALLPAPER_REGKEY, SPI_SETDESKWALLPAPER_VALNAME, buf, sizeof(buf)))
2132 lstrcpynW((WCHAR*)pvParam, buf, uiParam);
2136 /* Return an empty string */
2137 memset((WCHAR*)pvParam, 0, uiParam);
2143 WINE_SPI_FIXME(SPI_GETACTIVEWINDOWTRACKING);/* 0x1000 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2144 WINE_SPI_FIXME(SPI_SETACTIVEWINDOWTRACKING);/* 0x1001 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2145 case SPI_GETMENUANIMATION: /* 0x1002 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2146 ret = get_user_pref_param( 0, 0x02, pvParam );
2149 case SPI_SETMENUANIMATION: /* 0x1003 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2150 ret = set_user_pref_param( 0, 0x02, PtrToUlong(pvParam), fWinIni );
2153 case SPI_GETCOMBOBOXANIMATION: /* 0x1004 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2154 ret = get_user_pref_param( 0, 0x04, pvParam );
2157 case SPI_SETCOMBOBOXANIMATION: /* 0x1005 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2158 ret = set_user_pref_param( 0, 0x04, PtrToUlong(pvParam), fWinIni );
2161 case SPI_GETLISTBOXSMOOTHSCROLLING: /* 0x1006 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2162 ret = get_user_pref_param( 0, 0x08, pvParam );
2165 case SPI_SETLISTBOXSMOOTHSCROLLING: /* 0x1007 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2166 ret = set_user_pref_param( 0, 0x08, PtrToUlong(pvParam), fWinIni );
2169 case SPI_GETGRADIENTCAPTIONS:
2170 ret = get_user_pref_param( 0, 0x10, pvParam );
2173 case SPI_SETGRADIENTCAPTIONS:
2174 ret = set_user_pref_param( 0, 0x10, PtrToUlong(pvParam), fWinIni );
2177 case SPI_GETKEYBOARDCUES:
2178 ret = get_user_pref_param( 0, 0x20, pvParam );
2181 case SPI_SETKEYBOARDCUES:
2182 ret = set_user_pref_param( 0, 0x20, PtrToUlong(pvParam), fWinIni );
2185 WINE_SPI_FIXME(SPI_GETACTIVEWNDTRKZORDER); /* 0x100C _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2186 WINE_SPI_FIXME(SPI_SETACTIVEWNDTRKZORDER); /* 0x100D _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2187 case SPI_GETHOTTRACKING:
2188 ret = get_user_pref_param( 0, 0x80, pvParam );
2191 case SPI_SETHOTTRACKING:
2192 ret = set_user_pref_param( 0, 0x80, PtrToUlong(pvParam), fWinIni );
2195 WINE_SPI_FIXME(SPI_GETMENUFADE); /* 0x1012 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2196 WINE_SPI_FIXME(SPI_SETMENUFADE); /* 0x1013 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2197 case SPI_GETSELECTIONFADE: /* 0x1014 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2198 ret = get_user_pref_param( 1, 0x04, pvParam );
2201 case SPI_SETSELECTIONFADE: /* 0x1015 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2202 ret = set_user_pref_param( 1, 0x04, PtrToUlong(pvParam), fWinIni );
2205 case SPI_GETTOOLTIPANIMATION: /* 0x1016 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2206 ret = get_user_pref_param( 1, 0x08, pvParam );
2209 case SPI_SETTOOLTIPANIMATION: /* 0x1017 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2210 ret = set_user_pref_param( 1, 0x08, PtrToUlong(pvParam), fWinIni );
2213 case SPI_GETTOOLTIPFADE: /* 0x1018 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2214 ret = get_user_pref_param( 1, 0x10, pvParam );
2217 case SPI_SETTOOLTIPFADE: /* 0x1019 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2218 ret = set_user_pref_param( 1, 0x10, PtrToUlong(pvParam), fWinIni );
2221 case SPI_GETCURSORSHADOW: /* 0x101A _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2222 ret = get_user_pref_param( 1, 0x20, pvParam );
2225 case SPI_SETCURSORSHADOW: /* 0x101B _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2226 ret = set_user_pref_param( 1, 0x20, PtrToUlong(pvParam), fWinIni );
2229 WINE_SPI_FIXME(SPI_GETMOUSESONAR); /* 0x101C _WIN32_WINNT >= 0x510 || _WIN32_WINDOW >= 0x490*/
2230 WINE_SPI_FIXME(SPI_SETMOUSESONAR); /* 0x101D _WIN32_WINNT >= 0x510 || _WIN32_WINDOW >= 0x490*/
2231 WINE_SPI_FIXME(SPI_GETMOUSECLICKLOCK); /* 0x101E _WIN32_WINNT >= 0x510 || _WIN32_WINDOW >= 0x490*/
2232 WINE_SPI_FIXME(SPI_SETMOUSECLICKLOCK); /* 0x101F _WIN32_WINNT >= 0x510 || _WIN32_WINDOW >= 0x490*/
2233 WINE_SPI_FIXME(SPI_GETMOUSEVANISH); /* 0x1020 _WIN32_WINNT >= 0x510 || _WIN32_WINDOW >= 0x490*/
2234 WINE_SPI_FIXME(SPI_SETMOUSEVANISH); /* 0x1021 _WIN32_WINNT >= 0x510 || _WIN32_WINDOW >= 0x490*/
2235 case SPI_GETFLATMENU:
2236 ret = get_user_pref_param( 2, 0x02, pvParam );
2239 case SPI_SETFLATMENU:
2240 ret = set_user_pref_param( 2, 0x02, PtrToUlong(pvParam), fWinIni );
2243 WINE_SPI_FIXME(SPI_GETDROPSHADOW); /* 0x1024 _WIN32_WINNT >= 0x510 */
2244 WINE_SPI_FIXME(SPI_SETDROPSHADOW); /* 0x1025 _WIN32_WINNT >= 0x510 */
2245 WINE_SPI_FIXME(SPI_GETBLOCKSENDINPUTRESETS);
2246 WINE_SPI_FIXME(SPI_SETBLOCKSENDINPUTRESETS);
2247 case SPI_GETUIEFFECTS:
2248 ret = get_user_pref_param( 3, 0x80, pvParam );
2251 case SPI_SETUIEFFECTS:
2252 /* FIXME: this probably should mask other UI effect values when unset */
2253 ret = set_user_pref_param( 3, 0x80, PtrToUlong(pvParam), fWinIni );
2256 WINE_SPI_FIXME(SPI_GETFOREGROUNDLOCKTIMEOUT);/* 0x2000 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2257 WINE_SPI_FIXME(SPI_SETFOREGROUNDLOCKTIMEOUT);/* 0x2001 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2258 WINE_SPI_FIXME(SPI_GETACTIVEWNDTRKTIMEOUT); /* 0x2002 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2259 WINE_SPI_FIXME(SPI_SETACTIVEWNDTRKTIMEOUT); /* 0x2003 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2260 WINE_SPI_FIXME(SPI_GETFOREGROUNDFLASHCOUNT);/* 0x2004 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2261 WINE_SPI_FIXME(SPI_SETFOREGROUNDFLASHCOUNT);/* 0x2005 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2262 case SPI_GETCARETWIDTH: /* 0x2006 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2263 ret = get_uint_param( SPI_CARETWIDTH_IDX,
2264 SPI_CARETWIDTH_REGKEY,
2265 SPI_CARETWIDTH_VALNAME,
2266 &caret_width, pvParam );
2269 case SPI_SETCARETWIDTH: /* 0x2007 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2270 ret = set_uint_param( SPI_CARETWIDTH_IDX,
2271 SPI_CARETWIDTH_REGKEY,
2272 SPI_CARETWIDTH_VALNAME,
2273 &caret_width, uiParam, fWinIni );
2276 WINE_SPI_FIXME(SPI_GETMOUSECLICKLOCKTIME); /* 0x2008 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2277 WINE_SPI_FIXME(SPI_SETMOUSECLICKLOCKTIME); /* 0x2009 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2278 WINE_SPI_FIXME(SPI_GETFONTSMOOTHINGTYPE); /* 0x200A _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2279 WINE_SPI_FIXME(SPI_SETFONTSMOOTHINGTYPE); /* 0x200B _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */
2280 WINE_SPI_FIXME(SPI_GETFONTSMOOTHINGCONTRAST);/* 0x200C _WIN32_WINNT >= 0x510 */
2281 WINE_SPI_FIXME(SPI_SETFONTSMOOTHINGCONTRAST);/* 0x200D _WIN32_WINNT >= 0x510 */
2282 WINE_SPI_FIXME(SPI_GETFOCUSBORDERWIDTH); /* 0x200E _WIN32_WINNT >= 0x510 */
2283 WINE_SPI_FIXME(SPI_SETFOCUSBORDERWIDTH); /* 0x200F _WIN32_WINNT >= 0x510 */
2284 WINE_SPI_FIXME(SPI_GETFOCUSBORDERHEIGHT); /* 0x2010 _WIN32_WINNT >= 0x510 */
2285 WINE_SPI_FIXME(SPI_SETFOCUSBORDERHEIGHT); /* 0x2011 _WIN32_WINNT >= 0x510 */
2286 WINE_SPI_FIXME(SPI_GETFONTSMOOTHINGORIENTATION); /* 0x2012 */
2287 WINE_SPI_FIXME(SPI_SETFONTSMOOTHINGORIENTATION); /* 0x2013 */
2290 FIXME( "Unknown action: %u\n", uiAction );
2291 SetLastError( ERROR_INVALID_SPI_VALUE );
2297 SYSPARAMS_NotifyChange( uiAction, fWinIni );
2298 TRACE("(%u, %u, %p, %u) ret %d\n",
2299 uiAction, uiParam, pvParam, fWinIni, ret);
2302 #undef WINE_SPI_FIXME
2303 #undef WINE_SPI_WARN
2307 /***********************************************************************
2308 * SystemParametersInfo (USER.483)
2310 BOOL16 WINAPI SystemParametersInfo16( UINT16 uAction, UINT16 uParam,
2311 LPVOID lpvParam, UINT16 fuWinIni )
2315 TRACE("(%u, %u, %p, %u)\n", uAction, uParam, lpvParam, fuWinIni);
2319 case SPI_GETBEEP: /* 1 */
2320 case SPI_GETSCREENSAVEACTIVE: /* 16 */
2321 case SPI_GETICONTITLEWRAP: /* 25 */
2322 case SPI_GETMENUDROPALIGNMENT: /* 27 */
2323 case SPI_GETFASTTASKSWITCH: /* 35 */
2324 case SPI_GETDRAGFULLWINDOWS: /* 38 WINVER >= 0x0400 */
2327 ret = SystemParametersInfoA( uAction, uParam, lpvParam ? &tmp : NULL, fuWinIni );
2328 if (ret && lpvParam)
2329 *(BOOL16 *)lpvParam = tmp;
2333 case SPI_GETBORDER: /* 5 */
2334 case SPI_ICONHORIZONTALSPACING: /* 13 */
2335 case SPI_GETSCREENSAVETIMEOUT: /* 14 */
2336 case SPI_GETGRIDGRANULARITY: /* 18 */
2337 case SPI_GETKEYBOARDDELAY: /* 22 */
2338 case SPI_ICONVERTICALSPACING: /* 24 */
2341 ret = SystemParametersInfoA( uAction, uParam, lpvParam ? &tmp : NULL, fuWinIni );
2342 if (ret && lpvParam)
2343 *(INT16 *)lpvParam = tmp;
2347 case SPI_GETKEYBOARDSPEED: /* 10 */
2350 ret = SystemParametersInfoA( uAction, uParam, lpvParam ? &tmp : NULL, fuWinIni );
2351 if (ret && lpvParam)
2352 *(WORD *)lpvParam = tmp;
2356 case SPI_GETICONTITLELOGFONT: /* 31 */
2359 ret = SystemParametersInfoA( uAction, uParam, lpvParam ? &tmp : NULL, fuWinIni );
2360 if (ret && lpvParam)
2361 SYSPARAMS_LogFont32ATo16( &tmp, (LPLOGFONT16)lpvParam );
2365 case SPI_GETNONCLIENTMETRICS: /* 41 WINVER >= 0x400 */
2367 NONCLIENTMETRICSA tmp;
2368 LPNONCLIENTMETRICS16 lpnm16 = (LPNONCLIENTMETRICS16)lpvParam;
2369 if (lpnm16 && lpnm16->cbSize == sizeof(NONCLIENTMETRICS16))
2371 tmp.cbSize = sizeof(NONCLIENTMETRICSA);
2372 ret = SystemParametersInfoA( uAction, uParam, &tmp, fuWinIni );
2374 SYSPARAMS_NonClientMetrics32ATo16( &tmp, lpnm16 );
2376 else /* winfile 95 sets cbSize to 340 */
2377 ret = SystemParametersInfoA( uAction, uParam, lpvParam, fuWinIni );
2381 case SPI_GETWORKAREA: /* 48 WINVER >= 0x400 */
2384 ret = SystemParametersInfoA( uAction, uParam, lpvParam ? &tmp : NULL, fuWinIni );
2385 if (ret && lpvParam)
2387 RECT16 *r16 = (RECT16 *)lpvParam;
2388 r16->left = tmp.left;
2390 r16->right = tmp.right;
2391 r16->bottom = tmp.bottom;
2396 case SPI_GETMOUSEHOVERWIDTH: /* 98 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
2397 case SPI_GETMOUSEHOVERHEIGHT: /* 100 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
2398 case SPI_GETMOUSEHOVERTIME: /* 102 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
2401 ret = SystemParametersInfoA( uAction, uParam, lpvParam ? &tmp : NULL, fuWinIni );
2402 if (ret && lpvParam)
2403 *(UINT16 *)lpvParam = tmp;
2408 ret = SystemParametersInfoA( uAction, uParam, lpvParam, fuWinIni );
2414 /***********************************************************************
2415 * SystemParametersInfoA (USER32.@)
2417 BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam,
2418 PVOID pvParam, UINT fuWinIni )
2422 TRACE("(%u, %u, %p, %u)\n", uiAction, uiParam, pvParam, fuWinIni);
2426 case SPI_SETDESKWALLPAPER: /* 20 */
2427 case SPI_SETDESKPATTERN: /* 21 */
2431 if (!MultiByteToWideChar( CP_ACP, 0, (LPSTR)pvParam, -1,
2432 buffer, sizeof(buffer)/sizeof(WCHAR) ))
2433 buffer[sizeof(buffer)/sizeof(WCHAR)-1] = 0;
2434 ret = SystemParametersInfoW( uiAction, uiParam, pvParam ? buffer : NULL, fuWinIni );
2438 case SPI_GETICONTITLELOGFONT: /* 31 */
2441 ret = SystemParametersInfoW( uiAction, uiParam, pvParam ? &tmp : NULL, fuWinIni );
2443 SYSPARAMS_LogFont32WTo32A( &tmp, (LPLOGFONTA)pvParam );
2447 case SPI_GETNONCLIENTMETRICS: /* 41 WINVER >= 0x400 */
2449 NONCLIENTMETRICSW tmp;
2450 LPNONCLIENTMETRICSA lpnmA = (LPNONCLIENTMETRICSA)pvParam;
2451 if (lpnmA && lpnmA->cbSize == sizeof(NONCLIENTMETRICSA))
2453 tmp.cbSize = sizeof(NONCLIENTMETRICSW);
2454 ret = SystemParametersInfoW( uiAction, uiParam, &tmp, fuWinIni );
2456 SYSPARAMS_NonClientMetrics32WTo32A( &tmp, lpnmA );
2463 case SPI_SETNONCLIENTMETRICS: /* 42 WINVER >= 0x400 */
2465 NONCLIENTMETRICSW tmp;
2466 LPNONCLIENTMETRICSA lpnmA = (LPNONCLIENTMETRICSA)pvParam;
2467 if (lpnmA && lpnmA->cbSize == sizeof(NONCLIENTMETRICSA))
2469 tmp.cbSize = sizeof(NONCLIENTMETRICSW);
2470 SYSPARAMS_NonClientMetrics32ATo32W( lpnmA, &tmp );
2471 ret = SystemParametersInfoW( uiAction, uiParam, &tmp, fuWinIni );
2478 case SPI_GETICONMETRICS: /* 45 WINVER >= 0x400 */
2481 LPICONMETRICSA lpimA = (LPICONMETRICSA)pvParam;
2482 if (lpimA && lpimA->cbSize == sizeof(ICONMETRICSA))
2484 tmp.cbSize = sizeof(ICONMETRICSW);
2485 ret = SystemParametersInfoW( uiAction, uiParam, &tmp, fuWinIni );
2488 lpimA->iHorzSpacing = tmp.iHorzSpacing;
2489 lpimA->iVertSpacing = tmp.iVertSpacing;
2490 lpimA->iTitleWrap = tmp.iTitleWrap;
2491 SYSPARAMS_LogFont32WTo32A( &tmp.lfFont, &lpimA->lfFont );
2499 case SPI_SETICONMETRICS: /* 46 WINVER >= 0x400 */
2502 LPICONMETRICSA lpimA = (LPICONMETRICSA)pvParam;
2503 if (lpimA && lpimA->cbSize == sizeof(ICONMETRICSA))
2505 tmp.cbSize = sizeof(ICONMETRICSW);
2506 tmp.iHorzSpacing = lpimA->iHorzSpacing;
2507 tmp.iVertSpacing = lpimA->iVertSpacing;
2508 tmp.iTitleWrap = lpimA->iTitleWrap;
2509 SYSPARAMS_LogFont32ATo32W( &lpimA->lfFont, &tmp.lfFont);
2510 ret = SystemParametersInfoW( uiAction, uiParam, &tmp, fuWinIni );
2517 case SPI_GETHIGHCONTRAST: /* 66 WINVER >= 0x400 */
2520 LPHIGHCONTRASTA lphcA = (LPHIGHCONTRASTA)pvParam;
2521 if (lphcA && lphcA->cbSize == sizeof(HIGHCONTRASTA))
2523 tmp.cbSize = sizeof(HIGHCONTRASTW);
2524 ret = SystemParametersInfoW( uiAction, uiParam, &tmp, fuWinIni );
2527 lphcA->dwFlags = tmp.dwFlags;
2528 lphcA->lpszDefaultScheme = NULL; /* FIXME? */
2536 case SPI_GETDESKWALLPAPER: /* 115 */
2538 WCHAR buffer[MAX_PATH];
2539 ret = (SystemParametersInfoW( SPI_GETDESKWALLPAPER, uiParam, buffer, fuWinIni ) &&
2540 WideCharToMultiByte(CP_ACP, 0, buffer, -1, pvParam, uiParam, NULL, NULL));
2545 ret = SystemParametersInfoW( uiAction, uiParam, pvParam, fuWinIni );
2552 /***********************************************************************
2553 * GetSystemMetrics (USER32.@)
2555 INT WINAPI GetSystemMetrics( INT index )
2559 /* some metrics are dynamic */
2563 return GetDeviceCaps( get_display_dc(), HORZRES );
2565 return GetDeviceCaps( get_display_dc(), VERTRES );
2567 if (!spi_loaded[SPI_NONCLIENTMETRICS_IDX]) load_nonclient_metrics();
2568 return nonclient_metrics.iScrollWidth;
2570 return GetSystemMetrics(SM_CXVSCROLL);
2572 if (!spi_loaded[SPI_NONCLIENTMETRICS_IDX]) load_nonclient_metrics();
2573 return nonclient_metrics.iCaptionHeight + 1;
2576 /* SM_C{X,Y}BORDER always returns 1 regardless of 'BorderWidth' value in registry */
2582 if (!spi_loaded[SPI_NONCLIENTMETRICS_IDX]) load_nonclient_metrics();
2583 return nonclient_metrics.iScrollHeight;
2585 return GetSystemMetrics(SM_CYVTHUMB);
2587 if (!spi_loaded[SPI_NONCLIENTMETRICS_IDX]) load_nonclient_metrics();
2588 return icon_size.cx;
2590 if (!spi_loaded[SPI_NONCLIENTMETRICS_IDX]) load_nonclient_metrics();
2591 return icon_size.cy;
2596 return GetSystemMetrics(SM_CYMENUSIZE) + 1;
2597 case SM_CXFULLSCREEN:
2598 /* see the remark for SM_CXMAXIMIZED, at least this formulation is
2600 return GetSystemMetrics( SM_CXMAXIMIZED) - 2 * GetSystemMetrics( SM_CXFRAME);
2601 case SM_CYFULLSCREEN:
2602 /* see the remark for SM_CYMAXIMIZED, at least this formulation is
2604 return GetSystemMetrics( SM_CYMAXIMIZED) - GetSystemMetrics( SM_CYMIN);
2605 case SM_CYKANJIWINDOW:
2607 case SM_MOUSEPRESENT:
2610 if (!spi_loaded[SPI_NONCLIENTMETRICS_IDX]) load_nonclient_metrics();
2611 return nonclient_metrics.iScrollHeight;
2613 if (!spi_loaded[SPI_NONCLIENTMETRICS_IDX]) load_nonclient_metrics();
2614 return nonclient_metrics.iScrollHeight;
2618 get_bool_param( SPI_SETMOUSEBUTTONSWAP_IDX, SPI_SETMOUSEBUTTONSWAP_REGKEY,
2619 SPI_SETMOUSEBUTTONSWAP_VALNAME, &swap_buttons, (BOOL*)&ret );
2627 if (!spi_loaded[SPI_NONCLIENTMETRICS_IDX]) load_nonclient_metrics();
2628 return 3 * nonclient_metrics.iCaptionWidth + GetSystemMetrics( SM_CYSIZE) +
2629 4 * CaptionFontAvCharWidth + 2 * GetSystemMetrics( SM_CXFRAME) + 4;
2631 return GetSystemMetrics( SM_CYCAPTION) + 2 * GetSystemMetrics( SM_CYFRAME);
2633 if (!spi_loaded[SPI_NONCLIENTMETRICS_IDX]) load_nonclient_metrics();
2634 return nonclient_metrics.iCaptionWidth;
2636 if (!spi_loaded[SPI_NONCLIENTMETRICS_IDX]) load_nonclient_metrics();
2637 return nonclient_metrics.iCaptionHeight;
2639 if (!spi_loaded[SPI_NONCLIENTMETRICS_IDX]) load_nonclient_metrics();
2640 return GetSystemMetrics(SM_CXDLGFRAME) + nonclient_metrics.iBorderWidth;
2642 if (!spi_loaded[SPI_NONCLIENTMETRICS_IDX]) load_nonclient_metrics();
2643 return GetSystemMetrics(SM_CYDLGFRAME) + nonclient_metrics.iBorderWidth;
2645 return GetSystemMetrics(SM_CXMIN);
2647 return GetSystemMetrics(SM_CYMIN);
2648 case SM_CXDOUBLECLK:
2649 get_uint_param( SPI_SETDOUBLECLKWIDTH_IDX, SPI_SETDOUBLECLKWIDTH_REGKEY1,
2650 SPI_SETDOUBLECLKWIDTH_VALNAME, &double_click_width, &ret );
2652 case SM_CYDOUBLECLK:
2653 get_uint_param( SPI_SETDOUBLECLKHEIGHT_IDX, SPI_SETDOUBLECLKHEIGHT_REGKEY1,
2654 SPI_SETDOUBLECLKHEIGHT_VALNAME, &double_click_height, &ret );
2656 case SM_CXICONSPACING:
2657 SystemParametersInfoW( SPI_ICONHORIZONTALSPACING, 0, &ret, 0 );
2659 case SM_CYICONSPACING:
2660 SystemParametersInfoW( SPI_ICONVERTICALSPACING, 0, &ret, 0 );
2662 case SM_MENUDROPALIGNMENT:
2663 SystemParametersInfoW( SPI_GETMENUDROPALIGNMENT, 0, &ret, 0 );
2667 case SM_DBCSENABLED:
2670 GetCPInfo( CP_ACP, &cpinfo );
2671 return (cpinfo.MaxCharSize > 1);
2673 case SM_CMOUSEBUTTONS:
2678 return GetSystemMetrics(SM_CXBORDER) + 1;
2680 return GetSystemMetrics(SM_CYBORDER) + 1;
2681 case SM_CXMINSPACING:
2682 if( spi_loaded[SPI_MINIMIZEDMETRICS_IDX]) load_minimized_metrics();
2683 return GetSystemMetrics(SM_CXMINIMIZED) + minimized_metrics.iHorzGap;
2684 case SM_CYMINSPACING:
2685 if( spi_loaded[SPI_MINIMIZEDMETRICS_IDX]) load_minimized_metrics();
2686 return GetSystemMetrics(SM_CYMINIMIZED) + minimized_metrics.iVertGap;
2690 case SM_CYSMCAPTION:
2691 return GetSystemMetrics(SM_CYSMSIZE) + 1;
2693 if (!spi_loaded[SPI_NONCLIENTMETRICS_IDX]) load_nonclient_metrics();
2694 return nonclient_metrics.iSmCaptionWidth;
2696 if (!spi_loaded[SPI_NONCLIENTMETRICS_IDX]) load_nonclient_metrics();
2697 return nonclient_metrics.iSmCaptionHeight;
2699 if (!spi_loaded[SPI_NONCLIENTMETRICS_IDX]) load_nonclient_metrics();
2700 return nonclient_metrics.iMenuWidth;
2702 if (!spi_loaded[SPI_NONCLIENTMETRICS_IDX]) load_nonclient_metrics();
2703 return nonclient_metrics.iMenuHeight;
2705 if( spi_loaded[SPI_MINIMIZEDMETRICS_IDX]) load_minimized_metrics();
2706 return minimized_metrics.iArrange;
2707 case SM_CXMINIMIZED:
2708 if( spi_loaded[SPI_MINIMIZEDMETRICS_IDX]) load_minimized_metrics();
2709 return minimized_metrics.iWidth + 6;
2710 case SM_CYMINIMIZED:
2711 if (!spi_loaded[SPI_NONCLIENTMETRICS_IDX]) load_nonclient_metrics();
2712 return nonclient_metrics.iCaptionHeight + 6;
2714 return GetSystemMetrics(SM_CXVIRTUALSCREEN) + 4 + 2 * GetSystemMetrics(SM_CXFRAME);
2716 return GetSystemMetrics(SM_CYVIRTUALSCREEN) + 4 + 2 * GetSystemMetrics(SM_CYFRAME);
2717 case SM_CXMAXIMIZED:
2718 /* FIXME: subtract the width of any vertical application toolbars*/
2719 return GetSystemMetrics(SM_CXSCREEN) + 2 * GetSystemMetrics(SM_CXFRAME);
2720 case SM_CYMAXIMIZED:
2721 /* FIXME: subtract the width of any horizontal application toolbars*/
2722 return GetSystemMetrics(SM_CYSCREEN) + 2 * GetSystemMetrics(SM_CYCAPTION);
2724 return 3; /* FIXME */
2726 return 0; /* 0 = ok, 1 = failsafe, 2 = failsafe + network */
2731 SystemParametersInfoW( SPI_GETSHOWSOUNDS, 0, &ret, 0 );
2733 case SM_CXMENUCHECK:
2734 case SM_CYMENUCHECK:
2735 if (!spi_loaded[SPI_NONCLIENTMETRICS_IDX]) load_nonclient_metrics();
2736 return tmMenuFont.tmHeight <= 0 ? 13 :
2737 ((tmMenuFont.tmHeight + tmMenuFont.tmExternalLeading + 1) / 2) * 2 - 1;
2738 case SM_SLOWMACHINE:
2739 return 0; /* Never true */
2740 case SM_MIDEASTENABLED:
2741 return 0; /* FIXME */
2742 case SM_MOUSEWHEELPRESENT:
2744 case SM_XVIRTUALSCREEN:
2746 struct monitor_info info;
2747 get_monitors_info( &info );
2748 return info.virtual_rect.left;
2750 case SM_YVIRTUALSCREEN:
2752 struct monitor_info info;
2753 get_monitors_info( &info );
2754 return info.virtual_rect.top;
2756 case SM_CXVIRTUALSCREEN:
2758 struct monitor_info info;
2759 get_monitors_info( &info );
2760 return info.virtual_rect.right - info.virtual_rect.left;
2762 case SM_CYVIRTUALSCREEN:
2764 struct monitor_info info;
2765 get_monitors_info( &info );
2766 return info.virtual_rect.bottom - info.virtual_rect.top;
2770 struct monitor_info info;
2771 get_monitors_info( &info );
2774 case SM_SAMEDISPLAYFORMAT:
2777 return 0; /* FIXME */
2778 case SM_CXFOCUSBORDER:
2779 case SM_CYFOCUSBORDER:
2782 case SM_MEDIACENTER:
2792 /***********************************************************************
2793 * SwapMouseButton (USER32.@)
2794 * Reverse or restore the meaning of the left and right mouse buttons
2795 * fSwap [I ] TRUE - reverse, FALSE - original
2799 BOOL WINAPI SwapMouseButton( BOOL fSwap )
2801 BOOL prev = GetSystemMetrics(SM_SWAPBUTTON);
2802 SystemParametersInfoW(SPI_SETMOUSEBUTTONSWAP, fSwap, 0, 0);
2807 /**********************************************************************
2808 * SetDoubleClickTime (USER32.@)
2810 BOOL WINAPI SetDoubleClickTime( UINT interval )
2812 return SystemParametersInfoW(SPI_SETDOUBLECLICKTIME, interval, 0, 0);
2816 /**********************************************************************
2817 * GetDoubleClickTime (USER32.@)
2819 UINT WINAPI GetDoubleClickTime(void)
2823 get_uint_param( SPI_SETDOUBLECLICKTIME_IDX,
2824 SPI_SETDOUBLECLICKTIME_REGKEY,
2825 SPI_SETDOUBLECLICKTIME_VALNAME,
2826 &double_click_time, &time );
2827 if (!time) time = 500;
2832 /*************************************************************************
2833 * GetSysColor (USER32.@)
2835 COLORREF WINAPI GetSysColor( INT nIndex )
2837 if (nIndex >= 0 && nIndex < NUM_SYS_COLORS)
2838 return SysColors[nIndex];
2844 /*************************************************************************
2845 * SetSysColors (USER32.@)
2847 BOOL WINAPI SetSysColors( INT nChanges, const INT *lpSysColor,
2848 const COLORREF *lpColorValues )
2852 for (i = 0; i < nChanges; i++) SYSPARAMS_SetSysColor( lpSysColor[i], lpColorValues[i] );
2854 /* Send WM_SYSCOLORCHANGE message to all windows */
2856 SendMessageTimeoutW( HWND_BROADCAST, WM_SYSCOLORCHANGE, 0, 0, SMTO_ABORTIFHUNG, 2000, NULL );
2858 /* Repaint affected portions of all visible windows */
2860 RedrawWindow( GetDesktopWindow(), NULL, 0,
2861 RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ALLCHILDREN );
2866 /*************************************************************************
2867 * SetSysColorsTemp (USER32.@)
2871 * Called by W98SE desk.cpl Control Panel Applet:
2872 * handle = SetSysColorsTemp(ptr, ptr, nCount); ("set" call)
2873 * result = SetSysColorsTemp(NULL, NULL, handle); ("restore" call)
2875 * pPens is an array of COLORREF values, which seems to be used
2876 * to indicate the color values to create new pens with.
2878 * pBrushes is an array of solid brush handles (returned by a previous
2879 * CreateSolidBrush), which seems to contain the brush handles to set
2880 * for the system colors.
2882 * n seems to be used for
2883 * a) indicating the number of entries to operate on (length of pPens,
2885 * b) passing the handle that points to the previously used color settings.
2886 * I couldn't figure out in hell what kind of handle this is on
2887 * Windows. I just use a heap handle instead. Shouldn't matter anyway.
2890 * heap handle of our own copy of the current syscolors in case of
2891 * "set" call, i.e. pPens, pBrushes != NULL.
2892 * TRUE (unconditionally !) in case of "restore" call,
2893 * i.e. pPens, pBrushes == NULL.
2894 * FALSE in case of either pPens != NULL and pBrushes == NULL
2895 * or pPens == NULL and pBrushes != NULL.
2897 * I'm not sure whether this implementation is 100% correct. [AM]
2899 DWORD WINAPI SetSysColorsTemp( const COLORREF *pPens, const HBRUSH *pBrushes, DWORD n)
2903 if (pPens && pBrushes) /* "set" call */
2905 /* allocate our structure to remember old colors */
2906 LPVOID pOldCol = HeapAlloc(GetProcessHeap(), 0, sizeof(DWORD)+n*sizeof(HPEN)+n*sizeof(HBRUSH));
2908 *(DWORD *)p = n; p = (char*)p + sizeof(DWORD);
2909 memcpy(p, SysColorPens, n*sizeof(HPEN)); p = (char*)p + n*sizeof(HPEN);
2910 memcpy(p, SysColorBrushes, n*sizeof(HBRUSH)); p = (char*)p + n*sizeof(HBRUSH);
2912 for (i=0; i < n; i++)
2914 SysColorPens[i] = CreatePen( PS_SOLID, 1, pPens[i] );
2915 SysColorBrushes[i] = pBrushes[i];
2918 return (DWORD)pOldCol; /* FIXME: pointer truncation */
2920 if (!pPens && !pBrushes) /* "restore" call */
2922 LPVOID pOldCol = (LPVOID)n; /* FIXME: not 64-bit safe */
2924 DWORD nCount = *(DWORD *)p;
2925 p = (char*)p + sizeof(DWORD);
2927 for (i=0; i < nCount; i++)
2929 DeleteObject(SysColorPens[i]);
2930 SysColorPens[i] = *(HPEN *)p; p = (char*)p + sizeof(HPEN);
2932 for (i=0; i < nCount; i++)
2934 SysColorBrushes[i] = *(HBRUSH *)p; p = (char*)p + sizeof(HBRUSH);
2936 /* get rid of storage structure */
2937 HeapFree(GetProcessHeap(), 0, pOldCol);
2945 /***********************************************************************
2946 * GetSysColorBrush (USER32.@)
2948 HBRUSH WINAPI GetSysColorBrush( INT index )
2950 if (0 <= index && index < NUM_SYS_COLORS) return SysColorBrushes[index];
2951 WARN("Unknown index(%d)\n", index );
2952 return GetStockObject(LTGRAY_BRUSH);
2956 /***********************************************************************
2959 HPEN SYSCOLOR_GetPen( INT index )
2961 /* We can assert here, because this function is internal to Wine */
2962 assert (0 <= index && index < NUM_SYS_COLORS);
2963 return SysColorPens[index];
2967 /***********************************************************************
2968 * ChangeDisplaySettingsA (USER32.@)
2970 LONG WINAPI ChangeDisplaySettingsA( LPDEVMODEA devmode, DWORD flags )
2972 return ChangeDisplaySettingsExA(NULL,devmode,NULL,flags,NULL);
2976 /***********************************************************************
2977 * ChangeDisplaySettingsW (USER32.@)
2979 LONG WINAPI ChangeDisplaySettingsW( LPDEVMODEW devmode, DWORD flags )
2981 return ChangeDisplaySettingsExW(NULL,devmode,NULL,flags,NULL);
2985 /***********************************************************************
2986 * ChangeDisplaySettingsExA (USER32.@)
2988 LONG WINAPI ChangeDisplaySettingsExA( LPCSTR devname, LPDEVMODEA devmode, HWND hwnd,
2989 DWORD flags, LPVOID lparam )
2992 UNICODE_STRING nameW;
2994 if (devname) RtlCreateUnicodeStringFromAsciiz(&nameW, devname);
2995 else nameW.Buffer = NULL;
3001 devmodeW = GdiConvertToDevmodeW(devmode);
3002 ret = ChangeDisplaySettingsExW(nameW.Buffer, devmodeW, hwnd, flags, lparam);
3003 HeapFree(GetProcessHeap(), 0, devmodeW);
3007 ret = ChangeDisplaySettingsExW(nameW.Buffer, NULL, hwnd, flags, lparam);
3010 if (devname) RtlFreeUnicodeString(&nameW);
3015 /***********************************************************************
3016 * ChangeDisplaySettingsExW (USER32.@)
3018 LONG WINAPI ChangeDisplaySettingsExW( LPCWSTR devname, LPDEVMODEW devmode, HWND hwnd,
3019 DWORD flags, LPVOID lparam )
3021 /* make sure the desktop window is created before mode changing */
3024 return USER_Driver->pChangeDisplaySettingsEx( devname, devmode, hwnd, flags, lparam );
3028 /***********************************************************************
3029 * EnumDisplaySettingsW (USER32.@)
3032 * TRUE if nth setting exists found (described in the LPDEVMODEW struct)
3033 * FALSE if we do not have the nth setting
3035 BOOL WINAPI EnumDisplaySettingsW( LPCWSTR name, DWORD n, LPDEVMODEW devmode )
3037 return EnumDisplaySettingsExW(name, n, devmode, 0);
3041 /***********************************************************************
3042 * EnumDisplaySettingsA (USER32.@)
3044 BOOL WINAPI EnumDisplaySettingsA(LPCSTR name,DWORD n,LPDEVMODEA devmode)
3046 return EnumDisplaySettingsExA(name, n, devmode, 0);
3050 /***********************************************************************
3051 * EnumDisplaySettingsExA (USER32.@)
3053 BOOL WINAPI EnumDisplaySettingsExA(LPCSTR lpszDeviceName, DWORD iModeNum,
3054 LPDEVMODEA lpDevMode, DWORD dwFlags)
3058 UNICODE_STRING nameW;
3060 if (lpszDeviceName) RtlCreateUnicodeStringFromAsciiz(&nameW, lpszDeviceName);
3061 else nameW.Buffer = NULL;
3063 ret = EnumDisplaySettingsExW(nameW.Buffer,iModeNum,&devmodeW,dwFlags);
3066 lpDevMode->dmSize = sizeof(*lpDevMode);
3067 lpDevMode->dmSpecVersion = devmodeW.dmSpecVersion;
3068 lpDevMode->dmDriverVersion = devmodeW.dmDriverVersion;
3069 WideCharToMultiByte(CP_ACP, 0, devmodeW.dmDeviceName, -1,
3070 (LPSTR)lpDevMode->dmDeviceName, CCHDEVICENAME, NULL, NULL);
3071 lpDevMode->dmDriverExtra = 0; /* FIXME */
3072 lpDevMode->dmBitsPerPel = devmodeW.dmBitsPerPel;
3073 lpDevMode->dmPelsHeight = devmodeW.dmPelsHeight;
3074 lpDevMode->dmPelsWidth = devmodeW.dmPelsWidth;
3075 lpDevMode->u2.dmDisplayFlags = devmodeW.u2.dmDisplayFlags;
3076 lpDevMode->dmDisplayFrequency = devmodeW.dmDisplayFrequency;
3077 lpDevMode->dmFields = devmodeW.dmFields;
3079 lpDevMode->u1.s2.dmPosition.x = devmodeW.u1.s2.dmPosition.x;
3080 lpDevMode->u1.s2.dmPosition.y = devmodeW.u1.s2.dmPosition.y;
3081 lpDevMode->u1.s2.dmDisplayOrientation = devmodeW.u1.s2.dmDisplayOrientation;
3082 lpDevMode->u1.s2.dmDisplayFixedOutput = devmodeW.u1.s2.dmDisplayFixedOutput;
3084 if (lpszDeviceName) RtlFreeUnicodeString(&nameW);
3089 /***********************************************************************
3090 * EnumDisplaySettingsExW (USER32.@)
3092 BOOL WINAPI EnumDisplaySettingsExW(LPCWSTR lpszDeviceName, DWORD iModeNum,
3093 LPDEVMODEW lpDevMode, DWORD dwFlags)
3095 return USER_Driver->pEnumDisplaySettingsEx(lpszDeviceName, iModeNum, lpDevMode, dwFlags);