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/wingdi16.h"
41 #include "user_private.h"
42 #include "wine/gdi_driver.h"
43 #include "wine/unicode.h"
44 #include "wine/debug.h"
46 WINE_DEFAULT_DEBUG_CHANNEL(system
);
48 /* System parameter indexes */
56 * Names of the registry subkeys of HKEY_CURRENT_USER key and value names
57 * for the system parameters.
60 /* the various registry keys that are used to store parameters */
76 static const WCHAR COLORS_REGKEY
[] = {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','C','o','l','o','r','s',0};
77 static const WCHAR DESKTOP_REGKEY
[] = {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0};
78 static const WCHAR KEYBOARD_REGKEY
[] = {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','K','e','y','b','o','a','r','d',0};
79 static const WCHAR MOUSE_REGKEY
[] = {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','M','o','u','s','e',0};
80 static const WCHAR METRICS_REGKEY
[] = {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p','\\',
81 'W','i','n','d','o','w','M','e','t','r','i','c','s',0};
82 static const WCHAR SOUND_REGKEY
[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','S','o','u','n','d',0};
83 static const WCHAR VERSION_REGKEY
[] = {'S','o','f','t','w','a','r','e','\\',
84 'M','i','c','r','o','s','o','f','t','\\',
85 'W','i','n','d','o','w','s',' ','N','T','\\',
86 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
87 'W','i','n','d','o','w','s',0};
88 static const WCHAR SHOWSOUNDS_REGKEY
[] = {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\',
89 'A','c','c','e','s','s','i','b','i','l','i','t','y','\\',
90 'S','h','o','w','S','o','u','n','d','s',0};
91 static const WCHAR KEYBOARDPREF_REGKEY
[] = {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\',
92 'A','c','c','e','s','s','i','b','i','l','i','t','y','\\',
93 'K','e','y','b','o','a','r','d',' ','P','r','e','f','e','r','e','n','c','e',0};
94 static const WCHAR SCREENREADER_REGKEY
[] = {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\',
95 'A','c','c','e','s','s','i','b','i','l','i','t','y','\\',
96 'B','l','i','n','d',' ','A','c','c','e','s','s',0};
98 static const WCHAR
*parameter_key_names
[NB_PARAM_KEYS
] =
112 /* parameter key values; the first char is actually an enum parameter_key to specify the key */
113 static const WCHAR BEEP_VALNAME
[]= {SOUND_KEY
,'B','e','e','p',0};
114 static const WCHAR MOUSETHRESHOLD1_VALNAME
[]= {MOUSE_KEY
,'M','o','u','s','e','T','h','r','e','s','h','o','l','d','1',0};
115 static const WCHAR MOUSETHRESHOLD2_VALNAME
[]= {MOUSE_KEY
,'M','o','u','s','e','T','h','r','e','s','h','o','l','d','2',0};
116 static const WCHAR MOUSEACCELERATION_VALNAME
[]= {MOUSE_KEY
,'M','o','u','s','e','S','p','e','e','d',0};
117 static const WCHAR BORDER_VALNAME
[]= {METRICS_KEY
,'B','o','r','d','e','r','W','i','d','t','h',0};
118 static const WCHAR KEYBOARDSPEED_VALNAME
[]= {KEYBOARD_KEY
,'K','e','y','b','o','a','r','d','S','p','e','e','d',0};
119 static const WCHAR ICONHORIZONTALSPACING_VALNAME
[]= {METRICS_KEY
,'I','c','o','n','S','p','a','c','i','n','g',0};
120 static const WCHAR SCREENSAVETIMEOUT_VALNAME
[]= {DESKTOP_KEY
,'S','c','r','e','e','n','S','a','v','e','T','i','m','e','O','u','t',0};
121 static const WCHAR SCREENSAVEACTIVE_VALNAME
[]= {DESKTOP_KEY
,'S','c','r','e','e','n','S','a','v','e','A','c','t','i','v','e',0};
122 static const WCHAR GRIDGRANULARITY_VALNAME
[]= {DESKTOP_KEY
,'G','r','i','d','G','r','a','n','u','l','a','r','i','t','y',0};
123 static const WCHAR KEYBOARDDELAY_VALNAME
[]= {KEYBOARD_KEY
,'K','e','y','b','o','a','r','d','D','e','l','a','y',0};
124 static const WCHAR ICONVERTICALSPACING_VALNAME
[]= {METRICS_KEY
,'I','c','o','n','V','e','r','t','i','c','a','l','S','p','a','c','i','n','g',0};
125 static const WCHAR ICONTITLEWRAP_VALNAME
[]= {DESKTOP_KEY
,'I','c','o','n','T','i','t','l','e','W','r','a','p',0};
126 static const WCHAR ICONTITLEWRAP_MIRROR
[]= {METRICS_KEY
,'I','c','o','n','T','i','t','l','e','W','r','a','p',0};
127 static const WCHAR ICONTITLELOGFONT_VALNAME
[]= {METRICS_KEY
,'I','c','o','n','F','o','n','t',0};
128 static const WCHAR MENUDROPALIGNMENT_VALNAME
[]= {DESKTOP_KEY
,'M','e','n','u','D','r','o','p','A','l','i','g','n','m','e','n','t',0};
129 static const WCHAR MENUDROPALIGNMENT_MIRROR
[]= {VERSION_KEY
,'M','e','n','u','D','r','o','p','A','l','i','g','n','m','e','n','t',0};
130 static const WCHAR MOUSETRAILS_VALNAME
[]= {MOUSE_KEY
,'M','o','u','s','e','T','r','a','i','l','s',0};
131 static const WCHAR SNAPTODEFBUTTON_VALNAME
[]= {MOUSE_KEY
,'S','n','a','p','T','o','D','e','f','a','u','l','t','B','u','t','t','o','n',0};
132 static const WCHAR DOUBLECLKWIDTH_VALNAME
[]= {MOUSE_KEY
,'D','o','u','b','l','e','C','l','i','c','k','W','i','d','t','h',0};
133 static const WCHAR DOUBLECLKWIDTH_MIRROR
[]= {DESKTOP_KEY
,'D','o','u','b','l','e','C','l','i','c','k','W','i','d','t','h',0};
134 static const WCHAR DOUBLECLKHEIGHT_VALNAME
[]= {MOUSE_KEY
,'D','o','u','b','l','e','C','l','i','c','k','H','e','i','g','h','t',0};
135 static const WCHAR DOUBLECLKHEIGHT_MIRROR
[]= {DESKTOP_KEY
,'D','o','u','b','l','e','C','l','i','c','k','H','e','i','g','h','t',0};
136 static const WCHAR DOUBLECLICKTIME_VALNAME
[]= {MOUSE_KEY
,'D','o','u','b','l','e','C','l','i','c','k','S','p','e','e','d',0};
137 static const WCHAR MOUSEBUTTONSWAP_VALNAME
[]= {MOUSE_KEY
,'S','w','a','p','M','o','u','s','e','B','u','t','t','o','n','s',0};
138 static const WCHAR DRAGFULLWINDOWS_VALNAME
[]= {DESKTOP_KEY
,'D','r','a','g','F','u','l','l','W','i','n','d','o','w','s',0};
139 static const WCHAR SHOWSOUNDS_VALNAME
[]= {SHOWSOUNDS_KEY
,'O','n',0};
140 static const WCHAR KEYBOARDPREF_VALNAME
[]= {KEYBOARDPREF_KEY
,'O','n',0};
141 static const WCHAR SCREENREADER_VALNAME
[]= {SCREENREADER_KEY
,'O','n',0};
142 static const WCHAR DESKWALLPAPER_VALNAME
[]= {DESKTOP_KEY
,'W','a','l','l','p','a','p','e','r',0};
143 static const WCHAR DESKPATTERN_VALNAME
[]= {DESKTOP_KEY
,'P','a','t','t','e','r','n',0};
144 static const WCHAR FONTSMOOTHING_VALNAME
[]= {DESKTOP_KEY
,'F','o','n','t','S','m','o','o','t','h','i','n','g',0};
145 static const WCHAR DRAGWIDTH_VALNAME
[]= {DESKTOP_KEY
,'D','r','a','g','W','i','d','t','h',0};
146 static const WCHAR DRAGHEIGHT_VALNAME
[]= {DESKTOP_KEY
,'D','r','a','g','H','e','i','g','h','t',0};
147 static const WCHAR LOWPOWERACTIVE_VALNAME
[]= {DESKTOP_KEY
,'L','o','w','P','o','w','e','r','A','c','t','i','v','e',0};
148 static const WCHAR POWEROFFACTIVE_VALNAME
[]= {DESKTOP_KEY
,'P','o','w','e','r','O','f','f','A','c','t','i','v','e',0};
149 static const WCHAR USERPREFERENCESMASK_VALNAME
[]= {DESKTOP_KEY
,'U','s','e','r','P','r','e','f','e','r','e','n','c','e','s','M','a','s','k',0};
150 static const WCHAR MOUSEHOVERWIDTH_VALNAME
[]= {MOUSE_KEY
,'M','o','u','s','e','H','o','v','e','r','W','i','d','t','h',0};
151 static const WCHAR MOUSEHOVERHEIGHT_VALNAME
[]= {MOUSE_KEY
,'M','o','u','s','e','H','o','v','e','r','H','e','i','g','h','t',0};
152 static const WCHAR MOUSEHOVERTIME_VALNAME
[]= {MOUSE_KEY
,'M','o','u','s','e','H','o','v','e','r','T','i','m','e',0};
153 static const WCHAR WHEELSCROLLCHARS_VALNAME
[]= {DESKTOP_KEY
,'W','h','e','e','l','S','c','r','o','l','l','C','h','a','r','s',0};
154 static const WCHAR WHEELSCROLLLINES_VALNAME
[]= {DESKTOP_KEY
,'W','h','e','e','l','S','c','r','o','l','l','L','i','n','e','s',0};
155 static const WCHAR ACTIVEWINDOWTRACKING_VALNAME
[]= {MOUSE_KEY
,'A','c','t','i','v','e','W','i','n','d','o','w','T','r','a','c','k','i','n','g',0};
156 static const WCHAR MENUSHOWDELAY_VALNAME
[]= {DESKTOP_KEY
,'M','e','n','u','S','h','o','w','D','e','l','a','y',0};
157 static const WCHAR BLOCKSENDINPUTRESETS_VALNAME
[]= {DESKTOP_KEY
,'B','l','o','c','k','S','e','n','d','I','n','p','u','t','R','e','s','e','t','s',0};
158 static const WCHAR FOREGROUNDLOCKTIMEOUT_VALNAME
[]= {DESKTOP_KEY
,'F','o','r','e','g','r','o','u','n','d','L','o','c','k','T','i','m','e','o','u','t',0};
159 static const WCHAR ACTIVEWNDTRKTIMEOUT_VALNAME
[]= {DESKTOP_KEY
,'A','c','t','i','v','e','W','n','d','T','r','a','c','k','T','i','m','e','o','u','t',0};
160 static const WCHAR FOREGROUNDFLASHCOUNT_VALNAME
[]= {DESKTOP_KEY
,'F','o','r','e','g','r','o','u','n','d','F','l','a','s','h','C','o','u','n','t',0};
161 static const WCHAR CARETWIDTH_VALNAME
[]= {DESKTOP_KEY
,'C','a','r','e','t','W','i','d','t','h',0};
162 static const WCHAR MOUSECLICKLOCKTIME_VALNAME
[]= {DESKTOP_KEY
,'C','l','i','c','k','L','o','c','k','T','i','m','e',0};
163 static const WCHAR MOUSESPEED_VALNAME
[]= {MOUSE_KEY
,'M','o','u','s','e','S','e','n','s','i','t','i','v','i','t','y',0};
164 static const WCHAR FONTSMOOTHINGTYPE_VALNAME
[]= {DESKTOP_KEY
,'F','o','n','t','S','m','o','o','t','h','i','n','g','T','y','p','e',0};
165 static const WCHAR FONTSMOOTHINGCONTRAST_VALNAME
[]= {DESKTOP_KEY
,'F','o','n','t','S','m','o','o','t','h','i','n','g','G','a','m','m','a',0};
166 static const WCHAR FONTSMOOTHINGORIENTATION_VALNAME
[]= {DESKTOP_KEY
,'F','o','n','t','S','m','o','o','t','h','i','n','g','O','r','i','e','n','t','a','t','i','o','n',0};
167 static const WCHAR FOCUSBORDERWIDTH_VALNAME
[]= {DESKTOP_KEY
,'F','o','c','u','s','B','o','r','d','e','r','W','i','d','t','h',0};
168 static const WCHAR FOCUSBORDERHEIGHT_VALNAME
[]= {DESKTOP_KEY
,'F','o','c','u','s','B','o','r','d','e','r','H','e','i','g','h','t',0};
169 static const WCHAR SCROLLWIDTH_VALNAME
[]= {METRICS_KEY
,'S','c','r','o','l','l','W','i','d','t','h',0};
170 static const WCHAR SCROLLHEIGHT_VALNAME
[]= {METRICS_KEY
,'S','c','r','o','l','l','H','e','i','g','h','t',0};
171 static const WCHAR CAPTIONWIDTH_VALNAME
[]= {METRICS_KEY
,'C','a','p','t','i','o','n','W','i','d','t','h',0};
172 static const WCHAR CAPTIONHEIGHT_VALNAME
[]= {METRICS_KEY
,'C','a','p','t','i','o','n','H','e','i','g','h','t',0};
173 static const WCHAR SMCAPTIONWIDTH_VALNAME
[]= {METRICS_KEY
,'S','m','C','a','p','t','i','o','n','W','i','d','t','h',0};
174 static const WCHAR SMCAPTIONHEIGHT_VALNAME
[]= {METRICS_KEY
,'S','m','C','a','p','t','i','o','n','H','e','i','g','h','t',0};
175 static const WCHAR MENUWIDTH_VALNAME
[]= {METRICS_KEY
,'M','e','n','u','W','i','d','t','h',0};
176 static const WCHAR MENUHEIGHT_VALNAME
[]= {METRICS_KEY
,'M','e','n','u','H','e','i','g','h','t',0};
177 static const WCHAR PADDEDBORDERWIDTH_VALNAME
[]= {METRICS_KEY
,'P','a','d','d','e','d','B','o','r','d','e','r','W','i','d','t','h',0};
178 static const WCHAR CAPTIONLOGFONT_VALNAME
[]= {METRICS_KEY
,'C','a','p','t','i','o','n','F','o','n','t',0};
179 static const WCHAR SMCAPTIONLOGFONT_VALNAME
[]= {METRICS_KEY
,'S','m','C','a','p','t','i','o','n','F','o','n','t',0};
180 static const WCHAR MENULOGFONT_VALNAME
[]= {METRICS_KEY
,'M','e','n','u','F','o','n','t',0};
181 static const WCHAR MESSAGELOGFONT_VALNAME
[]= {METRICS_KEY
,'M','e','s','s','a','g','e','F','o','n','t',0};
182 static const WCHAR STATUSLOGFONT_VALNAME
[]= {METRICS_KEY
,'S','t','a','t','u','s','F','o','n','t',0};
183 static const WCHAR MINWIDTH_VALNAME
[] = {METRICS_KEY
,'M','i','n','W','i','d','t','h',0};
184 static const WCHAR MINHORZGAP_VALNAME
[] = {METRICS_KEY
,'M','i','n','H','o','r','z','G','a','p',0};
185 static const WCHAR MINVERTGAP_VALNAME
[] = {METRICS_KEY
,'M','i','n','V','e','r','t','G','a','p',0};
186 static const WCHAR MINARRANGE_VALNAME
[] = {METRICS_KEY
,'M','i','n','A','r','r','a','n','g','e',0};
187 static const WCHAR COLOR_SCROLLBAR_VALNAME
[] = {COLORS_KEY
,'S','c','r','o','l','l','b','a','r',0};
188 static const WCHAR COLOR_BACKGROUND_VALNAME
[] = {COLORS_KEY
,'B','a','c','k','g','r','o','u','n','d',0};
189 static const WCHAR COLOR_ACTIVECAPTION_VALNAME
[] = {COLORS_KEY
,'A','c','t','i','v','e','T','i','t','l','e',0};
190 static const WCHAR COLOR_INACTIVECAPTION_VALNAME
[] = {COLORS_KEY
,'I','n','a','c','t','i','v','e','T','i','t','l','e',0};
191 static const WCHAR COLOR_MENU_VALNAME
[] = {COLORS_KEY
,'M','e','n','u',0};
192 static const WCHAR COLOR_WINDOW_VALNAME
[] = {COLORS_KEY
,'W','i','n','d','o','w',0};
193 static const WCHAR COLOR_WINDOWFRAME_VALNAME
[] = {COLORS_KEY
,'W','i','n','d','o','w','F','r','a','m','e',0};
194 static const WCHAR COLOR_MENUTEXT_VALNAME
[] = {COLORS_KEY
,'M','e','n','u','T','e','x','t',0};
195 static const WCHAR COLOR_WINDOWTEXT_VALNAME
[] = {COLORS_KEY
,'W','i','n','d','o','w','T','e','x','t',0};
196 static const WCHAR COLOR_CAPTIONTEXT_VALNAME
[] = {COLORS_KEY
,'T','i','t','l','e','T','e','x','t',0};
197 static const WCHAR COLOR_ACTIVEBORDER_VALNAME
[] = {COLORS_KEY
,'A','c','t','i','v','e','B','o','r','d','e','r',0};
198 static const WCHAR COLOR_INACTIVEBORDER_VALNAME
[] = {COLORS_KEY
,'I','n','a','c','t','i','v','e','B','o','r','d','e','r',0};
199 static const WCHAR COLOR_APPWORKSPACE_VALNAME
[] = {COLORS_KEY
,'A','p','p','W','o','r','k','S','p','a','c','e',0};
200 static const WCHAR COLOR_HIGHLIGHT_VALNAME
[] = {COLORS_KEY
,'H','i','l','i','g','h','t',0};
201 static const WCHAR COLOR_HIGHLIGHTTEXT_VALNAME
[] = {COLORS_KEY
,'H','i','l','i','g','h','t','T','e','x','t',0};
202 static const WCHAR COLOR_BTNFACE_VALNAME
[] = {COLORS_KEY
,'B','u','t','t','o','n','F','a','c','e',0};
203 static const WCHAR COLOR_BTNSHADOW_VALNAME
[] = {COLORS_KEY
,'B','u','t','t','o','n','S','h','a','d','o','w',0};
204 static const WCHAR COLOR_GRAYTEXT_VALNAME
[] = {COLORS_KEY
,'G','r','a','y','T','e','x','t',0};
205 static const WCHAR COLOR_BTNTEXT_VALNAME
[] = {COLORS_KEY
,'B','u','t','t','o','n','T','e','x','t',0};
206 static const WCHAR COLOR_INACTIVECAPTIONTEXT_VALNAME
[] = {COLORS_KEY
,'I','n','a','c','t','i','v','e','T','i','t','l','e','T','e','x','t',0};
207 static const WCHAR COLOR_BTNHIGHLIGHT_VALNAME
[] = {COLORS_KEY
,'B','u','t','t','o','n','H','i','l','i','g','h','t',0};
208 static const WCHAR COLOR_3DDKSHADOW_VALNAME
[] = {COLORS_KEY
,'B','u','t','t','o','n','D','k','S','h','a','d','o','w',0};
209 static const WCHAR COLOR_3DLIGHT_VALNAME
[] = {COLORS_KEY
,'B','u','t','t','o','n','L','i','g','h','t',0};
210 static const WCHAR COLOR_INFOTEXT_VALNAME
[] = {COLORS_KEY
,'I','n','f','o','T','e','x','t',0};
211 static const WCHAR COLOR_INFOBK_VALNAME
[] = {COLORS_KEY
,'I','n','f','o','W','i','n','d','o','w',0};
212 static const WCHAR COLOR_ALTERNATEBTNFACE_VALNAME
[] = {COLORS_KEY
,'B','u','t','t','o','n','A','l','t','e','r','n','a','t','e','F','a','c','e',0};
213 static const WCHAR COLOR_HOTLIGHT_VALNAME
[] = {COLORS_KEY
,'H','o','t','T','r','a','c','k','i','n','g','C','o','l','o','r',0};
214 static const WCHAR COLOR_GRADIENTACTIVECAPTION_VALNAME
[] = {COLORS_KEY
,'G','r','a','d','i','e','n','t','A','c','t','i','v','e','T','i','t','l','e',0};
215 static const WCHAR COLOR_GRADIENTINACTIVECAPTION_VALNAME
[] = {COLORS_KEY
,'G','r','a','d','i','e','n','t','I','n','a','c','t','i','v','e','T','i','t','l','e',0};
216 static const WCHAR COLOR_MENUHILIGHT_VALNAME
[] = {COLORS_KEY
,'M','e','n','u','H','i','l','i','g','h','t',0};
217 static const WCHAR COLOR_MENUBAR_VALNAME
[] = {COLORS_KEY
,'M','e','n','u','B','a','r',0};
219 /* FIXME - real value */
220 static const WCHAR SCREENSAVERRUNNING_VALNAME
[]= {DESKTOP_KEY
,'W','I','N','E','_','S','c','r','e','e','n','S','a','v','e','r','R','u','n','n','i','n','g',0};
222 static const WCHAR WINE_CURRENT_USER_REGKEY
[] = {'S','o','f','t','w','a','r','e','\\',
225 /* volatile registry branch under WINE_CURRENT_USER_REGKEY for temporary values storage */
226 static const WCHAR WINE_CURRENT_USER_REGKEY_TEMP_PARAMS
[] = {'T','e','m','p','o','r','a','r','y',' ',
227 'S','y','s','t','e','m',' ',
228 'P','a','r','a','m','e','t','e','r','s',0};
230 static const WCHAR Yes
[] = {'Y','e','s',0};
231 static const WCHAR No
[] = {'N','o',0};
232 static const WCHAR CSu
[] = {'%','u',0};
233 static const WCHAR CSd
[] = {'%','d',0};
234 static const WCHAR CSrgb
[] = {'%','u',' ','%','u',' ','%','u',0};
236 static HDC display_dc
;
237 static CRITICAL_SECTION display_dc_section
;
238 static CRITICAL_SECTION_DEBUG critsect_debug
=
240 0, 0, &display_dc_section
,
241 { &critsect_debug
.ProcessLocksList
, &critsect_debug
.ProcessLocksList
},
242 0, 0, { (DWORD_PTR
)(__FILE__
": display_dc_section") }
244 static CRITICAL_SECTION display_dc_section
= { &critsect_debug
, -1 ,0, 0, 0, 0 };
247 /* Indicators whether system parameter value is loaded */
248 static char spi_loaded
[SPI_INDEX_COUNT
];
250 static BOOL notify_change
= TRUE
;
252 /* System parameters storage */
253 static RECT work_area
;
255 static HKEY volatile_base_key
;
257 union sysparam_all_entry
;
259 struct sysparam_entry
261 BOOL (*get
)( union sysparam_all_entry
*entry
, UINT int_param
, void *ptr_param
, UINT dpi
);
262 BOOL (*set
)( union sysparam_all_entry
*entry
, UINT int_param
, void *ptr_param
, UINT flags
);
263 BOOL (*init
)( union sysparam_all_entry
*entry
);
269 struct sysparam_uint_entry
271 struct sysparam_entry hdr
;
275 struct sysparam_bool_entry
277 struct sysparam_entry hdr
;
281 struct sysparam_dword_entry
283 struct sysparam_entry hdr
;
287 struct sysparam_rgb_entry
289 struct sysparam_entry hdr
;
295 struct sysparam_binary_entry
297 struct sysparam_entry hdr
;
302 struct sysparam_path_entry
304 struct sysparam_entry hdr
;
305 WCHAR path
[MAX_PATH
];
308 struct sysparam_font_entry
310 struct sysparam_entry hdr
;
315 struct sysparam_pref_entry
317 struct sysparam_entry hdr
;
318 struct sysparam_binary_entry
*parent
;
323 union sysparam_all_entry
325 struct sysparam_entry hdr
;
326 struct sysparam_uint_entry uint
;
327 struct sysparam_bool_entry
bool;
328 struct sysparam_dword_entry dword
;
329 struct sysparam_rgb_entry rgb
;
330 struct sysparam_binary_entry bin
;
331 struct sysparam_path_entry path
;
332 struct sysparam_font_entry font
;
333 struct sysparam_pref_entry pref
;
336 static void SYSPARAMS_LogFont16To32W( const LOGFONT16
*font16
, LPLOGFONTW font32
)
338 font32
->lfHeight
= font16
->lfHeight
;
339 font32
->lfWidth
= font16
->lfWidth
;
340 font32
->lfEscapement
= font16
->lfEscapement
;
341 font32
->lfOrientation
= font16
->lfOrientation
;
342 font32
->lfWeight
= font16
->lfWeight
;
343 font32
->lfItalic
= font16
->lfItalic
;
344 font32
->lfUnderline
= font16
->lfUnderline
;
345 font32
->lfStrikeOut
= font16
->lfStrikeOut
;
346 font32
->lfCharSet
= font16
->lfCharSet
;
347 font32
->lfOutPrecision
= font16
->lfOutPrecision
;
348 font32
->lfClipPrecision
= font16
->lfClipPrecision
;
349 font32
->lfQuality
= font16
->lfQuality
;
350 font32
->lfPitchAndFamily
= font16
->lfPitchAndFamily
;
351 MultiByteToWideChar( CP_ACP
, 0, font16
->lfFaceName
, -1, font32
->lfFaceName
, LF_FACESIZE
);
352 font32
->lfFaceName
[LF_FACESIZE
-1] = 0;
355 static void SYSPARAMS_LogFont32WTo32A( const LOGFONTW
* font32W
, LPLOGFONTA font32A
)
357 font32A
->lfHeight
= font32W
->lfHeight
;
358 font32A
->lfWidth
= font32W
->lfWidth
;
359 font32A
->lfEscapement
= font32W
->lfEscapement
;
360 font32A
->lfOrientation
= font32W
->lfOrientation
;
361 font32A
->lfWeight
= font32W
->lfWeight
;
362 font32A
->lfItalic
= font32W
->lfItalic
;
363 font32A
->lfUnderline
= font32W
->lfUnderline
;
364 font32A
->lfStrikeOut
= font32W
->lfStrikeOut
;
365 font32A
->lfCharSet
= font32W
->lfCharSet
;
366 font32A
->lfOutPrecision
= font32W
->lfOutPrecision
;
367 font32A
->lfClipPrecision
= font32W
->lfClipPrecision
;
368 font32A
->lfQuality
= font32W
->lfQuality
;
369 font32A
->lfPitchAndFamily
= font32W
->lfPitchAndFamily
;
370 WideCharToMultiByte( CP_ACP
, 0, font32W
->lfFaceName
, -1, font32A
->lfFaceName
, LF_FACESIZE
, NULL
, NULL
);
371 font32A
->lfFaceName
[LF_FACESIZE
-1] = 0;
374 static void SYSPARAMS_LogFont32ATo32W( const LOGFONTA
* font32A
, LPLOGFONTW font32W
)
376 font32W
->lfHeight
= font32A
->lfHeight
;
377 font32W
->lfWidth
= font32A
->lfWidth
;
378 font32W
->lfEscapement
= font32A
->lfEscapement
;
379 font32W
->lfOrientation
= font32A
->lfOrientation
;
380 font32W
->lfWeight
= font32A
->lfWeight
;
381 font32W
->lfItalic
= font32A
->lfItalic
;
382 font32W
->lfUnderline
= font32A
->lfUnderline
;
383 font32W
->lfStrikeOut
= font32A
->lfStrikeOut
;
384 font32W
->lfCharSet
= font32A
->lfCharSet
;
385 font32W
->lfOutPrecision
= font32A
->lfOutPrecision
;
386 font32W
->lfClipPrecision
= font32A
->lfClipPrecision
;
387 font32W
->lfQuality
= font32A
->lfQuality
;
388 font32W
->lfPitchAndFamily
= font32A
->lfPitchAndFamily
;
389 MultiByteToWideChar( CP_ACP
, 0, font32A
->lfFaceName
, -1, font32W
->lfFaceName
, LF_FACESIZE
);
390 font32W
->lfFaceName
[LF_FACESIZE
-1] = 0;
393 static void SYSPARAMS_NonClientMetrics32WTo32A( const NONCLIENTMETRICSW
* lpnm32W
, LPNONCLIENTMETRICSA lpnm32A
)
395 lpnm32A
->iBorderWidth
= lpnm32W
->iBorderWidth
;
396 lpnm32A
->iScrollWidth
= lpnm32W
->iScrollWidth
;
397 lpnm32A
->iScrollHeight
= lpnm32W
->iScrollHeight
;
398 lpnm32A
->iCaptionWidth
= lpnm32W
->iCaptionWidth
;
399 lpnm32A
->iCaptionHeight
= lpnm32W
->iCaptionHeight
;
400 SYSPARAMS_LogFont32WTo32A( &lpnm32W
->lfCaptionFont
, &lpnm32A
->lfCaptionFont
);
401 lpnm32A
->iSmCaptionWidth
= lpnm32W
->iSmCaptionWidth
;
402 lpnm32A
->iSmCaptionHeight
= lpnm32W
->iSmCaptionHeight
;
403 SYSPARAMS_LogFont32WTo32A( &lpnm32W
->lfSmCaptionFont
, &lpnm32A
->lfSmCaptionFont
);
404 lpnm32A
->iMenuWidth
= lpnm32W
->iMenuWidth
;
405 lpnm32A
->iMenuHeight
= lpnm32W
->iMenuHeight
;
406 SYSPARAMS_LogFont32WTo32A( &lpnm32W
->lfMenuFont
, &lpnm32A
->lfMenuFont
);
407 SYSPARAMS_LogFont32WTo32A( &lpnm32W
->lfStatusFont
, &lpnm32A
->lfStatusFont
);
408 SYSPARAMS_LogFont32WTo32A( &lpnm32W
->lfMessageFont
, &lpnm32A
->lfMessageFont
);
409 if (lpnm32A
->cbSize
> FIELD_OFFSET(NONCLIENTMETRICSA
, iPaddedBorderWidth
))
411 if (lpnm32W
->cbSize
> FIELD_OFFSET(NONCLIENTMETRICSW
, iPaddedBorderWidth
))
412 lpnm32A
->iPaddedBorderWidth
= lpnm32W
->iPaddedBorderWidth
;
414 lpnm32A
->iPaddedBorderWidth
= 0;
418 static void SYSPARAMS_NonClientMetrics32ATo32W( const NONCLIENTMETRICSA
* lpnm32A
, LPNONCLIENTMETRICSW lpnm32W
)
420 lpnm32W
->iBorderWidth
= lpnm32A
->iBorderWidth
;
421 lpnm32W
->iScrollWidth
= lpnm32A
->iScrollWidth
;
422 lpnm32W
->iScrollHeight
= lpnm32A
->iScrollHeight
;
423 lpnm32W
->iCaptionWidth
= lpnm32A
->iCaptionWidth
;
424 lpnm32W
->iCaptionHeight
= lpnm32A
->iCaptionHeight
;
425 SYSPARAMS_LogFont32ATo32W( &lpnm32A
->lfCaptionFont
, &lpnm32W
->lfCaptionFont
);
426 lpnm32W
->iSmCaptionWidth
= lpnm32A
->iSmCaptionWidth
;
427 lpnm32W
->iSmCaptionHeight
= lpnm32A
->iSmCaptionHeight
;
428 SYSPARAMS_LogFont32ATo32W( &lpnm32A
->lfSmCaptionFont
, &lpnm32W
->lfSmCaptionFont
);
429 lpnm32W
->iMenuWidth
= lpnm32A
->iMenuWidth
;
430 lpnm32W
->iMenuHeight
= lpnm32A
->iMenuHeight
;
431 SYSPARAMS_LogFont32ATo32W( &lpnm32A
->lfMenuFont
, &lpnm32W
->lfMenuFont
);
432 SYSPARAMS_LogFont32ATo32W( &lpnm32A
->lfStatusFont
, &lpnm32W
->lfStatusFont
);
433 SYSPARAMS_LogFont32ATo32W( &lpnm32A
->lfMessageFont
, &lpnm32W
->lfMessageFont
);
434 if (lpnm32W
->cbSize
> FIELD_OFFSET(NONCLIENTMETRICSW
, iPaddedBorderWidth
))
436 if (lpnm32A
->cbSize
> FIELD_OFFSET(NONCLIENTMETRICSA
, iPaddedBorderWidth
))
437 lpnm32W
->iPaddedBorderWidth
= lpnm32A
->iPaddedBorderWidth
;
439 lpnm32W
->iPaddedBorderWidth
= 0;
444 /* Helper functions to retrieve monitors info */
452 static BOOL CALLBACK
monitor_info_proc( HMONITOR monitor
, HDC hdc
, LPRECT rect
, LPARAM lp
)
454 struct monitor_info
*info
= (struct monitor_info
*)lp
;
456 UnionRect( &info
->virtual_rect
, &info
->virtual_rect
, rect
);
460 static void get_monitors_info( struct monitor_info
*info
)
463 SetRectEmpty( &info
->virtual_rect
);
464 EnumDisplayMonitors( 0, NULL
, monitor_info_proc
, (LPARAM
)info
);
467 RECT
get_virtual_screen_rect(void)
469 struct monitor_info info
;
470 get_monitors_info( &info
);
471 return info
.virtual_rect
;
474 /* get text metrics and/or "average" char width of the specified logfont
475 * for the specified dc */
476 static void get_text_metr_size( HDC hdc
, LOGFONTW
*plf
, TEXTMETRICW
* ptm
, UINT
*psz
)
478 HFONT hfont
, hfontsav
;
481 hfont
= CreateFontIndirectW( plf
);
482 if( !hfont
|| ( hfontsav
= SelectObject( hdc
, hfont
)) == NULL
) {
485 if( hfont
) DeleteObject( hfont
);
488 GetTextMetricsW( hdc
, ptm
);
490 if( !(*psz
= GdiGetCharDimensions( hdc
, ptm
, NULL
)))
492 SelectObject( hdc
, hfontsav
);
493 DeleteObject( hfont
);
496 /***********************************************************************
497 * SYSPARAMS_NotifyChange
499 * Sends notification about system parameter update.
501 static void SYSPARAMS_NotifyChange( UINT uiAction
, UINT fWinIni
)
503 static const WCHAR emptyW
[1];
507 if (fWinIni
& SPIF_UPDATEINIFILE
)
509 if (fWinIni
& (SPIF_SENDWININICHANGE
| SPIF_SENDCHANGE
))
510 SendMessageTimeoutW(HWND_BROADCAST
, WM_SETTINGCHANGE
,
511 uiAction
, (LPARAM
) emptyW
,
512 SMTO_ABORTIFHUNG
, 2000, NULL
);
516 /* FIXME notify other wine processes with internal message */
521 /* retrieve the cached base keys for a given entry */
522 static BOOL
get_base_keys( enum parameter_key index
, HKEY
*base_key
, HKEY
*volatile_key
)
524 static HKEY base_keys
[NB_PARAM_KEYS
];
525 static HKEY volatile_keys
[NB_PARAM_KEYS
];
528 if (!base_keys
[index
] && base_key
)
530 if (RegCreateKeyW( HKEY_CURRENT_USER
, parameter_key_names
[index
], &key
)) return FALSE
;
531 if (InterlockedCompareExchangePointer( (void **)&base_keys
[index
], key
, 0 ))
534 if (!volatile_keys
[index
] && volatile_key
)
536 if (RegCreateKeyExW( volatile_base_key
, parameter_key_names
[index
],
537 0, 0, REG_OPTION_VOLATILE
, KEY_ALL_ACCESS
, NULL
, &key
, 0 )) return FALSE
;
538 if (InterlockedCompareExchangePointer( (void **)&volatile_keys
[index
], key
, 0 ))
541 if (base_key
) *base_key
= base_keys
[index
];
542 if (volatile_key
) *volatile_key
= volatile_keys
[index
];
546 /* load a value to a registry entry */
547 static DWORD
load_entry( struct sysparam_entry
*entry
, void *data
, DWORD size
)
550 HKEY base_key
, volatile_key
;
552 if (!get_base_keys( entry
->regval
[0], &base_key
, &volatile_key
)) return FALSE
;
555 if (RegQueryValueExW( volatile_key
, entry
->regval
+ 1, NULL
, &type
, data
, &count
))
558 if (RegQueryValueExW( base_key
, entry
->regval
+ 1, NULL
, &type
, data
, &count
)) count
= 0;
560 /* make sure strings are null-terminated */
561 if (size
&& count
== size
&& type
== REG_SZ
) ((WCHAR
*)data
)[count
/ sizeof(WCHAR
) - 1] = 0;
562 entry
->loaded
= TRUE
;
566 /* save a value to a registry entry */
567 static BOOL
save_entry( const struct sysparam_entry
*entry
, const void *data
, DWORD size
,
568 DWORD type
, UINT flags
)
570 HKEY base_key
, volatile_key
;
572 if (flags
& SPIF_UPDATEINIFILE
)
574 if (!get_base_keys( entry
->regval
[0], &base_key
, &volatile_key
)) return FALSE
;
575 if (RegSetValueExW( base_key
, entry
->regval
+ 1, 0, type
, data
, size
)) return FALSE
;
576 RegDeleteValueW( volatile_key
, entry
->regval
+ 1 );
578 if (entry
->mirror
&& get_base_keys( entry
->mirror
[0], &base_key
, NULL
))
579 RegSetValueExW( base_key
, entry
->mirror
+ 1, 0, type
, data
, size
);
583 if (!get_base_keys( entry
->regval
[0], NULL
, &volatile_key
)) return FALSE
;
584 if (RegSetValueExW( volatile_key
, entry
->regval
+ 1, 0, type
, data
, size
)) return FALSE
;
589 /* save a string value to a registry entry */
590 static BOOL
save_entry_string( const struct sysparam_entry
*entry
, const WCHAR
*str
, UINT flags
)
592 return save_entry( entry
, str
, (strlenW(str
) + 1) * sizeof(WCHAR
), REG_SZ
, flags
);
595 /* initialize an entry in the registry if missing */
596 static BOOL
init_entry( struct sysparam_entry
*entry
, const void *data
, DWORD size
, DWORD type
)
600 if (!get_base_keys( entry
->regval
[0], &base_key
, NULL
)) return FALSE
;
601 if (!RegQueryValueExW( base_key
, entry
->regval
+ 1, NULL
, NULL
, NULL
, NULL
)) return TRUE
;
602 if (RegSetValueExW( base_key
, entry
->regval
+ 1, 0, type
, data
, size
)) return FALSE
;
603 if (entry
->mirror
&& get_base_keys( entry
->mirror
[0], &base_key
, NULL
))
604 RegSetValueExW( base_key
, entry
->mirror
+ 1, 0, type
, data
, size
);
605 entry
->loaded
= TRUE
;
609 /* initialize a string value in the registry if missing */
610 static BOOL
init_entry_string( struct sysparam_entry
*entry
, const WCHAR
*str
)
612 return init_entry( entry
, str
, (strlenW(str
) + 1) * sizeof(WCHAR
), REG_SZ
);
615 static DWORD
get_reg_dword( HKEY base
, const WCHAR
*key_name
, const WCHAR
*value_name
)
618 DWORD type
, ret
= 0, size
= sizeof(ret
);
620 if (RegOpenKeyW( base
, key_name
, &key
)) return 0;
621 if (RegQueryValueExW( key
, value_name
, NULL
, &type
, (void *)&ret
, &size
) || type
!= REG_DWORD
)
627 /* get the system dpi from the registry */
628 static UINT
get_system_dpi(void)
630 static const WCHAR dpi_key_name
[] = {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p','\0'};
631 static const WCHAR def_dpi_key_name
[] = {'S','o','f','t','w','a','r','e','\\','F','o','n','t','s','\0'};
632 static const WCHAR dpi_value_name
[] = {'L','o','g','P','i','x','e','l','s','\0'};
633 static UINT system_dpi
;
638 if (!(dpi
= get_reg_dword( HKEY_CURRENT_USER
, dpi_key_name
, dpi_value_name
)) &&
639 !(dpi
= get_reg_dword( HKEY_CURRENT_CONFIG
, def_dpi_key_name
, dpi_value_name
)))
640 dpi
= USER_DEFAULT_SCREEN_DPI
;
646 HDC
get_display_dc(void)
648 static const WCHAR DISPLAY
[] = {'D','I','S','P','L','A','Y',0};
649 EnterCriticalSection( &display_dc_section
);
650 if (!display_dc
) display_dc
= CreateDCW( DISPLAY
, NULL
, NULL
, NULL
);
654 void release_display_dc( HDC hdc
)
656 LeaveCriticalSection( &display_dc_section
);
659 /* map value from system dpi to standard 96 dpi for storing in the registry */
660 static int map_from_system_dpi( int val
)
662 return MulDiv( val
, USER_DEFAULT_SCREEN_DPI
, GetDpiForSystem() );
665 /* map value from 96 dpi to system or custom dpi */
666 static int map_to_dpi( int val
, UINT dpi
)
668 if (!dpi
) dpi
= GetDpiForSystem();
669 return MulDiv( val
, dpi
, USER_DEFAULT_SCREEN_DPI
);
672 static INT CALLBACK
real_fontname_proc(const LOGFONTW
*lf
, const TEXTMETRICW
*ntm
, DWORD type
, LPARAM lparam
)
674 const ENUMLOGFONTW
*elf
= (const ENUMLOGFONTW
*)lf
;
675 LOGFONTW
*lfW
= (LOGFONTW
*)lparam
;
677 lstrcpynW(lfW
->lfFaceName
, elf
->elfFullName
, LF_FACESIZE
);
681 static void get_real_fontname( HDC hdc
, LOGFONTW
*lf
)
683 EnumFontFamiliesExW(hdc
, lf
, real_fontname_proc
, (LPARAM
)lf
, 0);
686 /* adjust some of the raw values found in the registry */
687 static void normalize_nonclientmetrics( NONCLIENTMETRICSW
*pncm
)
690 HDC hdc
= get_display_dc();
692 if( pncm
->iBorderWidth
< 1) pncm
->iBorderWidth
= 1;
693 if( pncm
->iCaptionWidth
< 8) pncm
->iCaptionWidth
= 8;
694 if( pncm
->iScrollWidth
< 8) pncm
->iScrollWidth
= 8;
695 if( pncm
->iScrollHeight
< 8) pncm
->iScrollHeight
= 8;
697 /* adjust some heights to the corresponding font */
698 get_text_metr_size( hdc
, &pncm
->lfMenuFont
, &tm
, NULL
);
699 pncm
->iMenuHeight
= max( pncm
->iMenuHeight
, 2 + tm
.tmHeight
+ tm
.tmExternalLeading
);
700 get_real_fontname( hdc
, &pncm
->lfMenuFont
);
701 get_text_metr_size( hdc
, &pncm
->lfCaptionFont
, &tm
, NULL
);
702 pncm
->iCaptionHeight
= max( pncm
->iCaptionHeight
, 2 + tm
.tmHeight
);
703 get_real_fontname( hdc
, &pncm
->lfCaptionFont
);
704 get_text_metr_size( hdc
, &pncm
->lfSmCaptionFont
, &tm
, NULL
);
705 pncm
->iSmCaptionHeight
= max( pncm
->iSmCaptionHeight
, 2 + tm
.tmHeight
);
706 get_real_fontname( hdc
, &pncm
->lfSmCaptionFont
);
708 get_real_fontname( hdc
, &pncm
->lfStatusFont
);
709 get_real_fontname( hdc
, &pncm
->lfMessageFont
);
710 release_display_dc( hdc
);
713 static BOOL CALLBACK
enum_monitors( HMONITOR monitor
, HDC hdc
, LPRECT rect
, LPARAM lp
)
717 mi
.cbSize
= sizeof(mi
);
718 if (GetMonitorInfoW( monitor
, &mi
) && (mi
.dwFlags
& MONITORINFOF_PRIMARY
))
720 LPRECT work
= (LPRECT
)lp
;
727 /* load a uint parameter from the registry */
728 static BOOL
get_uint_entry( union sysparam_all_entry
*entry
, UINT int_param
, void *ptr_param
, UINT dpi
)
730 if (!ptr_param
) return FALSE
;
732 if (!entry
->hdr
.loaded
)
736 if (load_entry( &entry
->hdr
, buf
, sizeof(buf
) )) entry
->uint
.val
= atoiW( buf
);
738 *(UINT
*)ptr_param
= entry
->uint
.val
;
742 /* set a uint parameter in the registry */
743 static BOOL
set_uint_entry( union sysparam_all_entry
*entry
, UINT int_param
, void *ptr_param
, UINT flags
)
747 wsprintfW( buf
, CSu
, int_param
);
748 if (!save_entry_string( &entry
->hdr
, buf
, flags
)) return FALSE
;
749 entry
->uint
.val
= int_param
;
750 entry
->hdr
.loaded
= TRUE
;
754 /* initialize a uint parameter */
755 static BOOL
init_uint_entry( union sysparam_all_entry
*entry
)
759 wsprintfW( buf
, CSu
, entry
->uint
.val
);
760 return init_entry_string( &entry
->hdr
, buf
);
763 /* set an int parameter in the registry */
764 static BOOL
set_int_entry( union sysparam_all_entry
*entry
, UINT int_param
, void *ptr_param
, UINT flags
)
768 wsprintfW( buf
, CSd
, int_param
);
769 if (!save_entry_string( &entry
->hdr
, buf
, flags
)) return FALSE
;
770 entry
->uint
.val
= int_param
;
771 entry
->hdr
.loaded
= TRUE
;
775 /* initialize an int parameter */
776 static BOOL
init_int_entry( union sysparam_all_entry
*entry
)
780 wsprintfW( buf
, CSd
, entry
->uint
.val
);
781 return init_entry_string( &entry
->hdr
, buf
);
784 /* load a twips parameter from the registry */
785 static BOOL
get_twips_entry( union sysparam_all_entry
*entry
, UINT int_param
, void *ptr_param
, UINT dpi
)
789 if (!ptr_param
) return FALSE
;
791 if (!entry
->hdr
.loaded
)
795 if (load_entry( &entry
->hdr
, buf
, sizeof(buf
) )) entry
->uint
.val
= atoiW( buf
);
798 /* Dimensions are quoted as being "twips" values if negative and pixels if positive.
799 * One inch is 1440 twips.
801 * Technical Reference to the Windows 2000 Registry ->
802 * HKEY_CURRENT_USER -> Control Panel -> Desktop -> WindowMetrics
804 val
= entry
->uint
.val
;
806 val
= MulDiv( -val
, dpi
, 1440 );
808 val
= map_to_dpi( val
, dpi
);
810 *(int *)ptr_param
= val
;
814 /* set a twips parameter in the registry */
815 static BOOL
set_twips_entry( union sysparam_all_entry
*entry
, UINT int_param
, void *ptr_param
, UINT flags
)
818 if (val
> 0) val
= map_from_system_dpi( val
);
819 return set_int_entry( entry
, val
, ptr_param
, flags
);
822 /* load a bool parameter from the registry */
823 static BOOL
get_bool_entry( union sysparam_all_entry
*entry
, UINT int_param
, void *ptr_param
, UINT dpi
)
825 if (!ptr_param
) return FALSE
;
827 if (!entry
->hdr
.loaded
)
831 if (load_entry( &entry
->hdr
, buf
, sizeof(buf
) )) entry
->bool.val
= atoiW( buf
) != 0;
833 *(UINT
*)ptr_param
= entry
->bool.val
;
837 /* set a bool parameter in the registry */
838 static BOOL
set_bool_entry( union sysparam_all_entry
*entry
, UINT int_param
, void *ptr_param
, UINT flags
)
842 wsprintfW( buf
, CSu
, int_param
!= 0 );
843 if (!save_entry_string( &entry
->hdr
, buf
, flags
)) return FALSE
;
844 entry
->bool.val
= int_param
!= 0;
845 entry
->hdr
.loaded
= TRUE
;
849 /* initialize a bool parameter */
850 static BOOL
init_bool_entry( union sysparam_all_entry
*entry
)
854 wsprintfW( buf
, CSu
, entry
->bool.val
!= 0 );
855 return init_entry_string( &entry
->hdr
, buf
);
858 /* load a bool parameter using Yes/No strings from the registry */
859 static BOOL
get_yesno_entry( union sysparam_all_entry
*entry
, UINT int_param
, void *ptr_param
, UINT dpi
)
861 if (!ptr_param
) return FALSE
;
863 if (!entry
->hdr
.loaded
)
867 if (load_entry( &entry
->hdr
, buf
, sizeof(buf
) )) entry
->bool.val
= !lstrcmpiW( Yes
, buf
);
869 *(UINT
*)ptr_param
= entry
->bool.val
;
873 /* set a bool parameter using Yes/No strings from the registry */
874 static BOOL
set_yesno_entry( union sysparam_all_entry
*entry
, UINT int_param
, void *ptr_param
, UINT flags
)
876 const WCHAR
*str
= int_param
? Yes
: No
;
878 if (!save_entry_string( &entry
->hdr
, str
, flags
)) return FALSE
;
879 entry
->bool.val
= int_param
!= 0;
880 entry
->hdr
.loaded
= TRUE
;
884 /* initialize a bool parameter using Yes/No strings */
885 static BOOL
init_yesno_entry( union sysparam_all_entry
*entry
)
887 return init_entry_string( &entry
->hdr
, entry
->bool.val
? Yes
: No
);
890 /* load a dword (binary) parameter from the registry */
891 static BOOL
get_dword_entry( union sysparam_all_entry
*entry
, UINT int_param
, void *ptr_param
, UINT dpi
)
893 if (!ptr_param
) return FALSE
;
895 if (!entry
->hdr
.loaded
)
898 if (load_entry( &entry
->hdr
, &val
, sizeof(val
) ) == sizeof(DWORD
)) entry
->dword
.val
= val
;
900 *(DWORD
*)ptr_param
= entry
->bool.val
;
904 /* set a dword (binary) parameter in the registry */
905 static BOOL
set_dword_entry( union sysparam_all_entry
*entry
, UINT int_param
, void *ptr_param
, UINT flags
)
907 DWORD val
= PtrToUlong( ptr_param
);
909 if (!save_entry( &entry
->hdr
, &val
, sizeof(val
), REG_DWORD
, flags
)) return FALSE
;
910 entry
->dword
.val
= val
;
911 entry
->hdr
.loaded
= TRUE
;
915 /* initialize a dword parameter */
916 static BOOL
init_dword_entry( union sysparam_all_entry
*entry
)
918 return init_entry( &entry
->hdr
, &entry
->dword
.val
, sizeof(entry
->dword
.val
), REG_DWORD
);
921 /* load an RGB parameter from the registry */
922 static BOOL
get_rgb_entry( union sysparam_all_entry
*entry
, UINT int_param
, void *ptr_param
, UINT dpi
)
924 if (!ptr_param
) return FALSE
;
926 if (!entry
->hdr
.loaded
)
930 if (load_entry( &entry
->hdr
, buf
, sizeof(buf
) ))
933 WCHAR
*end
, *str
= buf
;
935 r
= strtoulW( str
, &end
, 10 );
936 if (end
== str
|| !*end
) goto done
;
938 g
= strtoulW( str
, &end
, 10 );
939 if (end
== str
|| !*end
) goto done
;
941 b
= strtoulW( str
, &end
, 10 );
942 if (end
== str
) goto done
;
943 if (r
> 255 || g
> 255 || b
> 255) goto done
;
944 entry
->rgb
.val
= RGB( r
, g
, b
);
948 *(COLORREF
*)ptr_param
= entry
->rgb
.val
;
952 /* set an RGB parameter in the registry */
953 static BOOL
set_rgb_entry( union sysparam_all_entry
*entry
, UINT int_param
, void *ptr_param
, UINT flags
)
959 wsprintfW( buf
, CSrgb
, GetRValue(int_param
), GetGValue(int_param
), GetBValue(int_param
) );
960 if (!save_entry_string( &entry
->hdr
, buf
, flags
)) return FALSE
;
961 entry
->rgb
.val
= int_param
;
962 entry
->hdr
.loaded
= TRUE
;
963 if ((brush
= InterlockedExchangePointer( (void **)&entry
->rgb
.brush
, 0 )))
965 __wine_make_gdi_object_system( brush
, FALSE
);
966 DeleteObject( brush
);
968 if ((pen
= InterlockedExchangePointer( (void **)&entry
->rgb
.pen
, 0 )))
970 __wine_make_gdi_object_system( pen
, FALSE
);
976 /* initialize an RGB parameter */
977 static BOOL
init_rgb_entry( union sysparam_all_entry
*entry
)
981 wsprintfW( buf
, CSrgb
, GetRValue(entry
->rgb
.val
), GetGValue(entry
->rgb
.val
), GetBValue(entry
->rgb
.val
) );
982 return init_entry_string( &entry
->hdr
, buf
);
985 /* load a font (binary) parameter from the registry */
986 static BOOL
get_font_entry( union sysparam_all_entry
*entry
, UINT int_param
, void *ptr_param
, UINT dpi
)
990 if (!ptr_param
) return FALSE
;
992 if (!entry
->hdr
.loaded
)
994 switch (load_entry( &entry
->hdr
, &font
, sizeof(font
) ))
997 if (font
.lfHeight
> 0) /* positive height value means points ( inch/72 ) */
998 font
.lfHeight
= -MulDiv( font
.lfHeight
, USER_DEFAULT_SCREEN_DPI
, 72 );
999 entry
->font
.val
= font
;
1001 case sizeof(LOGFONT16
): /* win9x-winME format */
1002 SYSPARAMS_LogFont16To32W( (LOGFONT16
*)&font
, &entry
->font
.val
);
1003 if (entry
->font
.val
.lfHeight
> 0)
1004 entry
->font
.val
.lfHeight
= -MulDiv( entry
->font
.val
.lfHeight
, USER_DEFAULT_SCREEN_DPI
, 72 );
1007 WARN( "Unknown format in key %s value %s\n",
1008 debugstr_w( parameter_key_names
[entry
->hdr
.regval
[0]] ),
1009 debugstr_w( entry
->hdr
.regval
+ 1 ));
1011 case 0: /* use the default GUI font */
1012 GetObjectW( GetStockObject( DEFAULT_GUI_FONT
), sizeof(font
), &font
);
1013 font
.lfHeight
= map_from_system_dpi( font
.lfHeight
);
1014 font
.lfWeight
= entry
->font
.weight
;
1015 entry
->font
.val
= font
;
1018 entry
->hdr
.loaded
= TRUE
;
1020 font
= entry
->font
.val
;
1021 font
.lfHeight
= map_to_dpi( font
.lfHeight
, dpi
);
1022 *(LOGFONTW
*)ptr_param
= font
;
1026 /* set a font (binary) parameter in the registry */
1027 static BOOL
set_font_entry( union sysparam_all_entry
*entry
, UINT int_param
, void *ptr_param
, UINT flags
)
1032 memcpy( &font
, ptr_param
, sizeof(font
) );
1033 /* zero pad the end of lfFaceName so we don't save uninitialised data */
1034 ptr
= memchrW( font
.lfFaceName
, 0, LF_FACESIZE
);
1035 if (ptr
) memset( ptr
, 0, (font
.lfFaceName
+ LF_FACESIZE
- ptr
) * sizeof(WCHAR
) );
1036 font
.lfHeight
= map_from_system_dpi( font
.lfHeight
);
1038 if (!save_entry( &entry
->hdr
, &font
, sizeof(font
), REG_BINARY
, flags
)) return FALSE
;
1039 entry
->font
.val
= font
;
1040 entry
->hdr
.loaded
= TRUE
;
1044 /* initialize a font (binary) parameter */
1045 static BOOL
init_font_entry( union sysparam_all_entry
*entry
)
1047 GetObjectW( GetStockObject( DEFAULT_GUI_FONT
), sizeof(entry
->font
.val
), &entry
->font
.val
);
1048 entry
->font
.val
.lfHeight
= map_from_system_dpi( entry
->font
.val
.lfHeight
);
1049 entry
->font
.val
.lfWeight
= entry
->font
.weight
;
1050 return init_entry( &entry
->hdr
, &entry
->font
.val
, sizeof(entry
->font
.val
), REG_BINARY
);
1053 /* get a path parameter in the registry */
1054 static BOOL
get_path_entry( union sysparam_all_entry
*entry
, UINT int_param
, void *ptr_param
, UINT dpi
)
1056 if (!ptr_param
) return FALSE
;
1058 if (!entry
->hdr
.loaded
)
1060 WCHAR buffer
[MAX_PATH
];
1062 if (load_entry( &entry
->hdr
, buffer
, sizeof(buffer
) ))
1063 lstrcpynW( entry
->path
.path
, buffer
, MAX_PATH
);
1065 lstrcpynW( ptr_param
, entry
->path
.path
, int_param
);
1069 /* set a path parameter in the registry */
1070 static BOOL
set_path_entry( union sysparam_all_entry
*entry
, UINT int_param
, void *ptr_param
, UINT flags
)
1072 WCHAR buffer
[MAX_PATH
];
1075 lstrcpynW( buffer
, ptr_param
, MAX_PATH
);
1076 ret
= save_entry_string( &entry
->hdr
, buffer
, flags
);
1079 strcpyW( entry
->path
.path
, buffer
);
1080 entry
->hdr
.loaded
= TRUE
;
1085 /* initialize a path parameter */
1086 static BOOL
init_path_entry( union sysparam_all_entry
*entry
)
1088 return init_entry_string( &entry
->hdr
, entry
->path
.path
);
1091 /* get a binary parameter in the registry */
1092 static BOOL
get_binary_entry( union sysparam_all_entry
*entry
, UINT int_param
, void *ptr_param
, UINT dpi
)
1094 if (!ptr_param
) return FALSE
;
1096 if (!entry
->hdr
.loaded
)
1098 void *buffer
= HeapAlloc( GetProcessHeap(), 0, entry
->bin
.size
);
1099 DWORD len
= load_entry( &entry
->hdr
, buffer
, entry
->bin
.size
);
1103 memcpy( entry
->bin
.ptr
, buffer
, entry
->bin
.size
);
1104 memset( (char *)entry
->bin
.ptr
+ len
, 0, entry
->bin
.size
- len
);
1106 HeapFree( GetProcessHeap(), 0, buffer
);
1108 memcpy( ptr_param
, entry
->bin
.ptr
, min( int_param
, entry
->bin
.size
) );
1112 /* set a binary parameter in the registry */
1113 static BOOL
set_binary_entry( union sysparam_all_entry
*entry
, UINT int_param
, void *ptr_param
, UINT flags
)
1116 void *buffer
= HeapAlloc( GetProcessHeap(), 0, entry
->bin
.size
);
1118 memcpy( buffer
, entry
->bin
.ptr
, entry
->bin
.size
);
1119 memcpy( buffer
, ptr_param
, min( int_param
, entry
->bin
.size
));
1120 ret
= save_entry( &entry
->hdr
, buffer
, entry
->bin
.size
, REG_BINARY
, flags
);
1123 memcpy( entry
->bin
.ptr
, buffer
, entry
->bin
.size
);
1124 entry
->hdr
.loaded
= TRUE
;
1126 HeapFree( GetProcessHeap(), 0, buffer
);
1130 /* initialize a binary parameter */
1131 static BOOL
init_binary_entry( union sysparam_all_entry
*entry
)
1133 return init_entry( &entry
->hdr
, entry
->bin
.ptr
, entry
->bin
.size
, REG_BINARY
);
1136 /* get a user pref parameter in the registry */
1137 static BOOL
get_userpref_entry( union sysparam_all_entry
*entry
, UINT int_param
, void *ptr_param
, UINT dpi
)
1139 union sysparam_all_entry
*parent_entry
= (union sysparam_all_entry
*)entry
->pref
.parent
;
1142 if (!ptr_param
) return FALSE
;
1144 if (!parent_entry
->hdr
.get( parent_entry
, sizeof(prefs
), prefs
, dpi
)) return FALSE
;
1145 *(BOOL
*)ptr_param
= (prefs
[entry
->pref
.offset
] & entry
->pref
.mask
) != 0;
1149 /* set a user pref parameter in the registry */
1150 static BOOL
set_userpref_entry( union sysparam_all_entry
*entry
, UINT int_param
, void *ptr_param
, UINT flags
)
1152 union sysparam_all_entry
*parent_entry
= (union sysparam_all_entry
*)entry
->pref
.parent
;
1155 parent_entry
->hdr
.loaded
= FALSE
; /* force loading it again */
1156 if (!parent_entry
->hdr
.get( parent_entry
, sizeof(prefs
), prefs
, GetDpiForSystem() )) return FALSE
;
1158 if (PtrToUlong( ptr_param
)) prefs
[entry
->pref
.offset
] |= entry
->pref
.mask
;
1159 else prefs
[entry
->pref
.offset
] &= ~entry
->pref
.mask
;
1161 return parent_entry
->hdr
.set( parent_entry
, sizeof(prefs
), prefs
, flags
);
1164 static BOOL
get_entry_dpi( void *ptr
, UINT int_param
, void *ptr_param
, UINT dpi
)
1166 union sysparam_all_entry
*entry
= ptr
;
1167 return entry
->hdr
.get( entry
, int_param
, ptr_param
, dpi
);
1170 static BOOL
get_entry( void *ptr
, UINT int_param
, void *ptr_param
)
1172 return get_entry_dpi( ptr
, int_param
, ptr_param
, GetDpiForSystem() );
1175 static BOOL
set_entry( void *ptr
, UINT int_param
, void *ptr_param
, UINT flags
)
1177 union sysparam_all_entry
*entry
= ptr
;
1178 return entry
->hdr
.set( entry
, int_param
, ptr_param
, flags
);
1181 #define UINT_ENTRY(name,val) \
1182 struct sysparam_uint_entry entry_##name = { { get_uint_entry, set_uint_entry, init_uint_entry, \
1183 name ##_VALNAME }, (val) }
1185 #define UINT_ENTRY_MIRROR(name,val) \
1186 struct sysparam_uint_entry entry_##name = { { get_uint_entry, set_uint_entry, init_uint_entry, \
1187 name ##_VALNAME, name ##_MIRROR }, (val) }
1189 #define INT_ENTRY(name,val) \
1190 struct sysparam_uint_entry entry_##name = { { get_uint_entry, set_int_entry, init_int_entry, \
1191 name ##_VALNAME }, (val) }
1193 #define BOOL_ENTRY(name,val) \
1194 struct sysparam_bool_entry entry_##name = { { get_bool_entry, set_bool_entry, init_bool_entry, \
1195 name ##_VALNAME }, (val) }
1197 #define BOOL_ENTRY_MIRROR(name,val) \
1198 struct sysparam_bool_entry entry_##name = { { get_bool_entry, set_bool_entry, init_bool_entry, \
1199 name ##_VALNAME, name ##_MIRROR }, (val) }
1201 #define YESNO_ENTRY(name,val) \
1202 struct sysparam_bool_entry entry_##name = { { get_yesno_entry, set_yesno_entry, init_yesno_entry, \
1203 name ##_VALNAME }, (val) }
1205 #define TWIPS_ENTRY(name,val) \
1206 struct sysparam_uint_entry entry_##name = { { get_twips_entry, set_twips_entry, init_int_entry, \
1207 name ##_VALNAME }, (val) }
1209 #define DWORD_ENTRY(name,val) \
1210 struct sysparam_dword_entry entry_##name = { { get_dword_entry, set_dword_entry, init_dword_entry, \
1211 name ##_VALNAME }, (val) }
1213 #define BINARY_ENTRY(name,data) \
1214 struct sysparam_binary_entry entry_##name = { { get_binary_entry, set_binary_entry, init_binary_entry, \
1215 name ##_VALNAME }, data, sizeof(data) }
1217 #define PATH_ENTRY(name) \
1218 struct sysparam_path_entry entry_##name = { { get_path_entry, set_path_entry, init_path_entry, \
1221 #define FONT_ENTRY(name,weight) \
1222 struct sysparam_font_entry entry_##name = { { get_font_entry, set_font_entry, init_font_entry, \
1223 name ##_VALNAME }, (weight) }
1225 #define USERPREF_ENTRY(name,offset,mask) \
1226 struct sysparam_pref_entry entry_##name = { { get_userpref_entry, set_userpref_entry }, \
1227 &entry_USERPREFERENCESMASK, (offset), (mask) }
1229 static UINT_ENTRY( DRAGWIDTH
, 4 );
1230 static UINT_ENTRY( DRAGHEIGHT
, 4 );
1231 static UINT_ENTRY( DOUBLECLICKTIME
, 500 );
1232 static UINT_ENTRY( FONTSMOOTHING
, 2 );
1233 static UINT_ENTRY( GRIDGRANULARITY
, 0 );
1234 static UINT_ENTRY( KEYBOARDDELAY
, 1 );
1235 static UINT_ENTRY( KEYBOARDSPEED
, 31 );
1236 static UINT_ENTRY( MENUSHOWDELAY
, 400 );
1237 static UINT_ENTRY( MINARRANGE
, ARW_HIDE
);
1238 static UINT_ENTRY( MINHORZGAP
, 0 );
1239 static UINT_ENTRY( MINVERTGAP
, 0 );
1240 static UINT_ENTRY( MINWIDTH
, 154 );
1241 static UINT_ENTRY( MOUSEHOVERHEIGHT
, 4 );
1242 static UINT_ENTRY( MOUSEHOVERTIME
, 400 );
1243 static UINT_ENTRY( MOUSEHOVERWIDTH
, 4 );
1244 static UINT_ENTRY( MOUSESPEED
, 10 );
1245 static UINT_ENTRY( MOUSETRAILS
, 0 );
1246 static UINT_ENTRY( SCREENSAVETIMEOUT
, 300 );
1247 static UINT_ENTRY( WHEELSCROLLCHARS
, 3 );
1248 static UINT_ENTRY( WHEELSCROLLLINES
, 3 );
1249 static UINT_ENTRY_MIRROR( DOUBLECLKHEIGHT
, 4 );
1250 static UINT_ENTRY_MIRROR( DOUBLECLKWIDTH
, 4 );
1251 static UINT_ENTRY_MIRROR( MENUDROPALIGNMENT
, 0 );
1253 static INT_ENTRY( MOUSETHRESHOLD1
, 6 );
1254 static INT_ENTRY( MOUSETHRESHOLD2
, 10 );
1255 static INT_ENTRY( MOUSEACCELERATION
, 1 );
1257 static BOOL_ENTRY( BLOCKSENDINPUTRESETS
, FALSE
);
1258 static BOOL_ENTRY( DRAGFULLWINDOWS
, FALSE
);
1259 static BOOL_ENTRY( KEYBOARDPREF
, TRUE
);
1260 static BOOL_ENTRY( LOWPOWERACTIVE
, FALSE
);
1261 static BOOL_ENTRY( MOUSEBUTTONSWAP
, FALSE
);
1262 static BOOL_ENTRY( POWEROFFACTIVE
, FALSE
);
1263 static BOOL_ENTRY( SCREENREADER
, FALSE
);
1264 static BOOL_ENTRY( SCREENSAVEACTIVE
, TRUE
);
1265 static BOOL_ENTRY( SCREENSAVERRUNNING
, FALSE
);
1266 static BOOL_ENTRY( SHOWSOUNDS
, FALSE
);
1267 static BOOL_ENTRY( SNAPTODEFBUTTON
, FALSE
);
1268 static BOOL_ENTRY_MIRROR( ICONTITLEWRAP
, TRUE
);
1270 static YESNO_ENTRY( BEEP
, TRUE
);
1272 static TWIPS_ENTRY( BORDER
, -15 );
1273 static TWIPS_ENTRY( CAPTIONHEIGHT
, -270 );
1274 static TWIPS_ENTRY( CAPTIONWIDTH
, -270 );
1275 static TWIPS_ENTRY( ICONHORIZONTALSPACING
, -1125 );
1276 static TWIPS_ENTRY( ICONVERTICALSPACING
, -1125 );
1277 static TWIPS_ENTRY( MENUHEIGHT
, -270 );
1278 static TWIPS_ENTRY( MENUWIDTH
, -270 );
1279 static TWIPS_ENTRY( PADDEDBORDERWIDTH
, 0 );
1280 static TWIPS_ENTRY( SCROLLHEIGHT
, -240 );
1281 static TWIPS_ENTRY( SCROLLWIDTH
, -240 );
1282 static TWIPS_ENTRY( SMCAPTIONHEIGHT
, -225 );
1283 static TWIPS_ENTRY( SMCAPTIONWIDTH
, -225 );
1285 static DWORD_ENTRY( ACTIVEWINDOWTRACKING
, 0 );
1286 static DWORD_ENTRY( ACTIVEWNDTRKTIMEOUT
, 0 );
1287 static DWORD_ENTRY( CARETWIDTH
, 1 );
1288 static DWORD_ENTRY( FOCUSBORDERHEIGHT
, 1 );
1289 static DWORD_ENTRY( FOCUSBORDERWIDTH
, 1 );
1290 static DWORD_ENTRY( FONTSMOOTHINGCONTRAST
, 0 );
1291 static DWORD_ENTRY( FONTSMOOTHINGORIENTATION
, FE_FONTSMOOTHINGORIENTATIONRGB
);
1292 static DWORD_ENTRY( FONTSMOOTHINGTYPE
, FE_FONTSMOOTHINGSTANDARD
);
1293 static DWORD_ENTRY( FOREGROUNDFLASHCOUNT
, 3 );
1294 static DWORD_ENTRY( FOREGROUNDLOCKTIMEOUT
, 0 );
1295 static DWORD_ENTRY( MOUSECLICKLOCKTIME
, 1200 );
1297 static PATH_ENTRY( DESKPATTERN
);
1298 static PATH_ENTRY( DESKWALLPAPER
);
1300 static BYTE user_prefs
[8] = { 0x30, 0x00, 0x00, 0x80, 0x10, 0x00, 0x00, 0x00 };
1301 static BINARY_ENTRY( USERPREFERENCESMASK
, user_prefs
);
1303 static FONT_ENTRY( CAPTIONLOGFONT
, FW_BOLD
);
1304 static FONT_ENTRY( ICONTITLELOGFONT
, FW_NORMAL
);
1305 static FONT_ENTRY( MENULOGFONT
, FW_NORMAL
);
1306 static FONT_ENTRY( MESSAGELOGFONT
, FW_NORMAL
);
1307 static FONT_ENTRY( SMCAPTIONLOGFONT
, FW_NORMAL
);
1308 static FONT_ENTRY( STATUSLOGFONT
, FW_NORMAL
);
1310 static USERPREF_ENTRY( MENUANIMATION
, 0, 0x02 );
1311 static USERPREF_ENTRY( COMBOBOXANIMATION
, 0, 0x04 );
1312 static USERPREF_ENTRY( LISTBOXSMOOTHSCROLLING
, 0, 0x08 );
1313 static USERPREF_ENTRY( GRADIENTCAPTIONS
, 0, 0x10 );
1314 static USERPREF_ENTRY( KEYBOARDCUES
, 0, 0x20 );
1315 static USERPREF_ENTRY( ACTIVEWNDTRKZORDER
, 0, 0x40 );
1316 static USERPREF_ENTRY( HOTTRACKING
, 0, 0x80 );
1317 static USERPREF_ENTRY( MENUFADE
, 1, 0x02 );
1318 static USERPREF_ENTRY( SELECTIONFADE
, 1, 0x04 );
1319 static USERPREF_ENTRY( TOOLTIPANIMATION
, 1, 0x08 );
1320 static USERPREF_ENTRY( TOOLTIPFADE
, 1, 0x10 );
1321 static USERPREF_ENTRY( CURSORSHADOW
, 1, 0x20 );
1322 static USERPREF_ENTRY( MOUSESONAR
, 1, 0x40 );
1323 static USERPREF_ENTRY( MOUSECLICKLOCK
, 1, 0x80 );
1324 static USERPREF_ENTRY( MOUSEVANISH
, 2, 0x01 );
1325 static USERPREF_ENTRY( FLATMENU
, 2, 0x02 );
1326 static USERPREF_ENTRY( DROPSHADOW
, 2, 0x04 );
1327 static USERPREF_ENTRY( UIEFFECTS
, 3, 0x80 );
1328 static USERPREF_ENTRY( DISABLEOVERLAPPEDCONTENT
, 4, 0x01 );
1329 static USERPREF_ENTRY( CLIENTAREAANIMATION
, 4, 0x02 );
1330 static USERPREF_ENTRY( CLEARTYPE
, 4, 0x10 );
1331 static USERPREF_ENTRY( SPEECHRECOGNITION
, 4, 0x20 );
1333 static struct sysparam_rgb_entry system_colors
[] =
1335 #define RGB_ENTRY(name,val) { { get_rgb_entry, set_rgb_entry, init_rgb_entry, name ##_VALNAME }, (val) }
1336 RGB_ENTRY( COLOR_SCROLLBAR
, RGB(212, 208, 200) ),
1337 RGB_ENTRY( COLOR_BACKGROUND
, RGB(58, 110, 165) ),
1338 RGB_ENTRY( COLOR_ACTIVECAPTION
, RGB(10, 36, 106) ),
1339 RGB_ENTRY( COLOR_INACTIVECAPTION
, RGB(128, 128, 128) ),
1340 RGB_ENTRY( COLOR_MENU
, RGB(212, 208, 200) ),
1341 RGB_ENTRY( COLOR_WINDOW
, RGB(255, 255, 255) ),
1342 RGB_ENTRY( COLOR_WINDOWFRAME
, RGB(0, 0, 0) ),
1343 RGB_ENTRY( COLOR_MENUTEXT
, RGB(0, 0, 0) ),
1344 RGB_ENTRY( COLOR_WINDOWTEXT
, RGB(0, 0, 0) ),
1345 RGB_ENTRY( COLOR_CAPTIONTEXT
, RGB(255, 255, 255) ),
1346 RGB_ENTRY( COLOR_ACTIVEBORDER
, RGB(212, 208, 200) ),
1347 RGB_ENTRY( COLOR_INACTIVEBORDER
, RGB(212, 208, 200) ),
1348 RGB_ENTRY( COLOR_APPWORKSPACE
, RGB(128, 128, 128) ),
1349 RGB_ENTRY( COLOR_HIGHLIGHT
, RGB(10, 36, 106) ),
1350 RGB_ENTRY( COLOR_HIGHLIGHTTEXT
, RGB(255, 255, 255) ),
1351 RGB_ENTRY( COLOR_BTNFACE
, RGB(212, 208, 200) ),
1352 RGB_ENTRY( COLOR_BTNSHADOW
, RGB(128, 128, 128) ),
1353 RGB_ENTRY( COLOR_GRAYTEXT
, RGB(128, 128, 128) ),
1354 RGB_ENTRY( COLOR_BTNTEXT
, RGB(0, 0, 0) ),
1355 RGB_ENTRY( COLOR_INACTIVECAPTIONTEXT
, RGB(212, 208, 200) ),
1356 RGB_ENTRY( COLOR_BTNHIGHLIGHT
, RGB(255, 255, 255) ),
1357 RGB_ENTRY( COLOR_3DDKSHADOW
, RGB(64, 64, 64) ),
1358 RGB_ENTRY( COLOR_3DLIGHT
, RGB(212, 208, 200) ),
1359 RGB_ENTRY( COLOR_INFOTEXT
, RGB(0, 0, 0) ),
1360 RGB_ENTRY( COLOR_INFOBK
, RGB(255, 255, 225) ),
1361 RGB_ENTRY( COLOR_ALTERNATEBTNFACE
, RGB(181, 181, 181) ),
1362 RGB_ENTRY( COLOR_HOTLIGHT
, RGB(0, 0, 200) ),
1363 RGB_ENTRY( COLOR_GRADIENTACTIVECAPTION
, RGB(166, 202, 240) ),
1364 RGB_ENTRY( COLOR_GRADIENTINACTIVECAPTION
, RGB(192, 192, 192) ),
1365 RGB_ENTRY( COLOR_MENUHILIGHT
, RGB(10, 36, 106) ),
1366 RGB_ENTRY( COLOR_MENUBAR
, RGB(212, 208, 200) )
1370 /* entries that are initialized by default in the registry */
1371 static union sysparam_all_entry
* const default_entries
[] =
1373 (union sysparam_all_entry
*)&entry_ACTIVEWINDOWTRACKING
,
1374 (union sysparam_all_entry
*)&entry_ACTIVEWNDTRKTIMEOUT
,
1375 (union sysparam_all_entry
*)&entry_BEEP
,
1376 (union sysparam_all_entry
*)&entry_BLOCKSENDINPUTRESETS
,
1377 (union sysparam_all_entry
*)&entry_BORDER
,
1378 (union sysparam_all_entry
*)&entry_CAPTIONHEIGHT
,
1379 (union sysparam_all_entry
*)&entry_CAPTIONWIDTH
,
1380 (union sysparam_all_entry
*)&entry_CARETWIDTH
,
1381 (union sysparam_all_entry
*)&entry_DESKWALLPAPER
,
1382 (union sysparam_all_entry
*)&entry_DOUBLECLICKTIME
,
1383 (union sysparam_all_entry
*)&entry_DOUBLECLKHEIGHT
,
1384 (union sysparam_all_entry
*)&entry_DOUBLECLKWIDTH
,
1385 (union sysparam_all_entry
*)&entry_DRAGFULLWINDOWS
,
1386 (union sysparam_all_entry
*)&entry_DRAGHEIGHT
,
1387 (union sysparam_all_entry
*)&entry_DRAGWIDTH
,
1388 (union sysparam_all_entry
*)&entry_FOCUSBORDERHEIGHT
,
1389 (union sysparam_all_entry
*)&entry_FOCUSBORDERWIDTH
,
1390 (union sysparam_all_entry
*)&entry_FONTSMOOTHING
,
1391 (union sysparam_all_entry
*)&entry_FONTSMOOTHINGCONTRAST
,
1392 (union sysparam_all_entry
*)&entry_FONTSMOOTHINGORIENTATION
,
1393 (union sysparam_all_entry
*)&entry_FONTSMOOTHINGTYPE
,
1394 (union sysparam_all_entry
*)&entry_FOREGROUNDFLASHCOUNT
,
1395 (union sysparam_all_entry
*)&entry_FOREGROUNDLOCKTIMEOUT
,
1396 (union sysparam_all_entry
*)&entry_ICONHORIZONTALSPACING
,
1397 (union sysparam_all_entry
*)&entry_ICONTITLEWRAP
,
1398 (union sysparam_all_entry
*)&entry_ICONVERTICALSPACING
,
1399 (union sysparam_all_entry
*)&entry_KEYBOARDDELAY
,
1400 (union sysparam_all_entry
*)&entry_KEYBOARDPREF
,
1401 (union sysparam_all_entry
*)&entry_KEYBOARDSPEED
,
1402 (union sysparam_all_entry
*)&entry_LOWPOWERACTIVE
,
1403 (union sysparam_all_entry
*)&entry_MENUHEIGHT
,
1404 (union sysparam_all_entry
*)&entry_MENUSHOWDELAY
,
1405 (union sysparam_all_entry
*)&entry_MENUWIDTH
,
1406 (union sysparam_all_entry
*)&entry_MOUSEACCELERATION
,
1407 (union sysparam_all_entry
*)&entry_MOUSEBUTTONSWAP
,
1408 (union sysparam_all_entry
*)&entry_MOUSECLICKLOCKTIME
,
1409 (union sysparam_all_entry
*)&entry_MOUSEHOVERHEIGHT
,
1410 (union sysparam_all_entry
*)&entry_MOUSEHOVERTIME
,
1411 (union sysparam_all_entry
*)&entry_MOUSEHOVERWIDTH
,
1412 (union sysparam_all_entry
*)&entry_MOUSESPEED
,
1413 (union sysparam_all_entry
*)&entry_MOUSETHRESHOLD1
,
1414 (union sysparam_all_entry
*)&entry_MOUSETHRESHOLD2
,
1415 (union sysparam_all_entry
*)&entry_PADDEDBORDERWIDTH
,
1416 (union sysparam_all_entry
*)&entry_SCREENREADER
,
1417 (union sysparam_all_entry
*)&entry_SCROLLHEIGHT
,
1418 (union sysparam_all_entry
*)&entry_SCROLLWIDTH
,
1419 (union sysparam_all_entry
*)&entry_SHOWSOUNDS
,
1420 (union sysparam_all_entry
*)&entry_SMCAPTIONHEIGHT
,
1421 (union sysparam_all_entry
*)&entry_SMCAPTIONWIDTH
,
1422 (union sysparam_all_entry
*)&entry_SNAPTODEFBUTTON
,
1423 (union sysparam_all_entry
*)&entry_USERPREFERENCESMASK
,
1424 (union sysparam_all_entry
*)&entry_WHEELSCROLLCHARS
,
1425 (union sysparam_all_entry
*)&entry_WHEELSCROLLLINES
,
1428 /***********************************************************************
1431 void SYSPARAMS_Init(void)
1436 /* this one must be non-volatile */
1437 if (RegCreateKeyW( HKEY_CURRENT_USER
, WINE_CURRENT_USER_REGKEY
, &key
))
1439 ERR("Can't create wine registry branch\n");
1443 /* @@ Wine registry key: HKCU\Software\Wine\Temporary System Parameters */
1444 if (RegCreateKeyExW( key
, WINE_CURRENT_USER_REGKEY_TEMP_PARAMS
, 0, 0,
1445 REG_OPTION_VOLATILE
, KEY_ALL_ACCESS
, 0, &volatile_base_key
, &dispos
))
1446 ERR("Can't create non-permanent wine registry branch\n");
1450 if (volatile_base_key
&& dispos
== REG_CREATED_NEW_KEY
) /* first process, initialize entries */
1452 for (i
= 0; i
< ARRAY_SIZE( default_entries
); i
++)
1453 default_entries
[i
]->hdr
.init( default_entries
[i
] );
1457 static BOOL
update_desktop_wallpaper(void)
1461 if (GetWindowThreadProcessId( GetDesktopWindow(), &pid
) && pid
== GetCurrentProcessId())
1463 WCHAR wallpaper
[MAX_PATH
], pattern
[256];
1465 entry_DESKWALLPAPER
.hdr
.loaded
= entry_DESKPATTERN
.hdr
.loaded
= FALSE
;
1466 if (get_entry( &entry_DESKWALLPAPER
, MAX_PATH
, wallpaper
) &&
1467 get_entry( &entry_DESKPATTERN
, 256, pattern
))
1468 update_wallpaper( wallpaper
, pattern
);
1470 else SendMessageW( GetDesktopWindow(), WM_SETTINGCHANGE
, SPI_SETDESKWALLPAPER
, 0 );
1475 /***********************************************************************
1476 * SystemParametersInfoForDpi (USER32.@)
1478 BOOL WINAPI
SystemParametersInfoForDpi( UINT action
, UINT val
, PVOID ptr
, UINT winini
, UINT dpi
)
1484 case SPI_GETICONTITLELOGFONT
:
1485 ret
= get_entry_dpi( &entry_ICONTITLELOGFONT
, val
, ptr
, dpi
);
1487 case SPI_GETNONCLIENTMETRICS
:
1489 NONCLIENTMETRICSW
*ncm
= ptr
;
1492 ret
= get_entry_dpi( &entry_BORDER
, 0, &ncm
->iBorderWidth
, dpi
) &&
1493 get_entry_dpi( &entry_SCROLLWIDTH
, 0, &ncm
->iScrollWidth
, dpi
) &&
1494 get_entry_dpi( &entry_SCROLLHEIGHT
, 0, &ncm
->iScrollHeight
, dpi
) &&
1495 get_entry_dpi( &entry_CAPTIONWIDTH
, 0, &ncm
->iCaptionWidth
, dpi
) &&
1496 get_entry_dpi( &entry_CAPTIONHEIGHT
, 0, &ncm
->iCaptionHeight
, dpi
) &&
1497 get_entry_dpi( &entry_CAPTIONLOGFONT
, 0, &ncm
->lfCaptionFont
, dpi
) &&
1498 get_entry_dpi( &entry_SMCAPTIONWIDTH
, 0, &ncm
->iSmCaptionWidth
, dpi
) &&
1499 get_entry_dpi( &entry_SMCAPTIONHEIGHT
, 0, &ncm
->iSmCaptionHeight
, dpi
) &&
1500 get_entry_dpi( &entry_SMCAPTIONLOGFONT
, 0, &ncm
->lfSmCaptionFont
, dpi
) &&
1501 get_entry_dpi( &entry_MENUWIDTH
, 0, &ncm
->iMenuWidth
, dpi
) &&
1502 get_entry_dpi( &entry_MENUHEIGHT
, 0, &ncm
->iMenuHeight
, dpi
) &&
1503 get_entry_dpi( &entry_MENULOGFONT
, 0, &ncm
->lfMenuFont
, dpi
) &&
1504 get_entry_dpi( &entry_STATUSLOGFONT
, 0, &ncm
->lfStatusFont
, dpi
) &&
1505 get_entry_dpi( &entry_MESSAGELOGFONT
, 0, &ncm
->lfMessageFont
, dpi
);
1506 if (ret
&& ncm
->cbSize
== sizeof(NONCLIENTMETRICSW
))
1507 ret
= get_entry_dpi( &entry_PADDEDBORDERWIDTH
, 0, &ncm
->iPaddedBorderWidth
, dpi
);
1508 normalize_nonclientmetrics( ncm
);
1511 case SPI_GETICONMETRICS
:
1513 ICONMETRICSW
*im
= ptr
;
1514 if (im
&& im
->cbSize
== sizeof(*im
))
1515 ret
= get_entry_dpi( &entry_ICONHORIZONTALSPACING
, 0, &im
->iHorzSpacing
, dpi
) &&
1516 get_entry_dpi( &entry_ICONVERTICALSPACING
, 0, &im
->iVertSpacing
, dpi
) &&
1517 get_entry_dpi( &entry_ICONTITLEWRAP
, 0, &im
->iTitleWrap
, dpi
) &&
1518 get_entry_dpi( &entry_ICONTITLELOGFONT
, 0, &im
->lfFont
, dpi
);
1522 SetLastError( ERROR_INVALID_PARAMETER
);
1529 /***********************************************************************
1530 * SystemParametersInfoW (USER32.@)
1532 * Each system parameter has flag which shows whether the parameter
1533 * is loaded or not. Parameters, stored directly in SysParametersInfo are
1534 * loaded from registry only when they are requested and the flag is
1535 * "false", after the loading the flag is set to "true". On interprocess
1536 * notification of the parameter change the corresponding parameter flag is
1537 * set to "false". The parameter value will be reloaded when it is requested
1539 * Parameters, backed by or depend on GetSystemMetrics are processed
1540 * differently. These parameters are always loaded. They are reloaded right
1541 * away on interprocess change notification. We can't do lazy loading because
1542 * we don't want to complicate GetSystemMetrics.
1543 * Parameters, backed by X settings are read from corresponding setting.
1544 * On the parameter change request the setting is changed. Interprocess change
1545 * notifications are ignored.
1546 * When parameter value is updated the changed value is stored in permanent
1547 * registry branch if saving is requested. Otherwise it is stored
1548 * in temporary branch
1550 * Some SPI values can also be stored as Twips values in the registry,
1551 * don't forget the conversion!
1553 BOOL WINAPI
SystemParametersInfoW( UINT uiAction
, UINT uiParam
,
1554 PVOID pvParam
, UINT fWinIni
)
1556 #define WINE_SPI_FIXME(x) \
1559 static BOOL warn = TRUE; \
1563 FIXME( "Unimplemented action: %u (%s)\n", x, #x ); \
1566 SetLastError( ERROR_INVALID_SPI_VALUE ); \
1569 #define WINE_SPI_WARN(x) \
1571 WARN( "Ignored action: %u (%s)\n", x, #x ); \
1575 BOOL ret
= USER_Driver
->pSystemParametersInfo( uiAction
, uiParam
, pvParam
, fWinIni
);
1576 unsigned spi_idx
= 0;
1578 if (!ret
) switch (uiAction
)
1581 ret
= get_entry( &entry_BEEP
, uiParam
, pvParam
);
1584 ret
= set_entry( &entry_BEEP
, uiParam
, pvParam
, fWinIni
);
1587 ret
= get_entry( &entry_MOUSETHRESHOLD1
, uiParam
, (INT
*)pvParam
) &&
1588 get_entry( &entry_MOUSETHRESHOLD2
, uiParam
, (INT
*)pvParam
+ 1 ) &&
1589 get_entry( &entry_MOUSEACCELERATION
, uiParam
, (INT
*)pvParam
+ 2 );
1592 ret
= set_entry( &entry_MOUSETHRESHOLD1
, ((INT
*)pvParam
)[0], pvParam
, fWinIni
) &&
1593 set_entry( &entry_MOUSETHRESHOLD2
, ((INT
*)pvParam
)[1], pvParam
, fWinIni
) &&
1594 set_entry( &entry_MOUSEACCELERATION
, ((INT
*)pvParam
)[2], pvParam
, fWinIni
);
1597 ret
= get_entry( &entry_BORDER
, uiParam
, pvParam
);
1598 if (*(INT
*)pvParam
< 1) *(INT
*)pvParam
= 1;
1601 ret
= set_entry( &entry_BORDER
, uiParam
, pvParam
, fWinIni
);
1603 case SPI_GETKEYBOARDSPEED
:
1604 ret
= get_entry( &entry_KEYBOARDSPEED
, uiParam
, pvParam
);
1606 case SPI_SETKEYBOARDSPEED
:
1607 if (uiParam
> 31) uiParam
= 31;
1608 ret
= set_entry( &entry_KEYBOARDSPEED
, uiParam
, pvParam
, fWinIni
);
1611 /* not implemented in Windows */
1612 WINE_SPI_WARN(SPI_LANGDRIVER
); /* 12 */
1614 case SPI_ICONHORIZONTALSPACING
:
1615 if (pvParam
!= NULL
)
1616 ret
= get_entry( &entry_ICONHORIZONTALSPACING
, uiParam
, pvParam
);
1619 int min_val
= map_to_dpi( 32, GetDpiForSystem() );
1620 ret
= set_entry( &entry_ICONHORIZONTALSPACING
, max( min_val
, uiParam
), pvParam
, fWinIni
);
1623 case SPI_GETSCREENSAVETIMEOUT
:
1624 ret
= get_entry( &entry_SCREENSAVETIMEOUT
, uiParam
, pvParam
);
1626 case SPI_SETSCREENSAVETIMEOUT
:
1627 ret
= set_entry( &entry_SCREENSAVETIMEOUT
, uiParam
, pvParam
, fWinIni
);
1629 case SPI_GETSCREENSAVEACTIVE
:
1630 ret
= get_entry( &entry_SCREENSAVEACTIVE
, uiParam
, pvParam
);
1632 case SPI_SETSCREENSAVEACTIVE
:
1633 ret
= set_entry( &entry_SCREENSAVEACTIVE
, uiParam
, pvParam
, fWinIni
);
1635 case SPI_GETGRIDGRANULARITY
:
1636 ret
= get_entry( &entry_GRIDGRANULARITY
, uiParam
, pvParam
);
1638 case SPI_SETGRIDGRANULARITY
:
1639 ret
= set_entry( &entry_GRIDGRANULARITY
, uiParam
, pvParam
, fWinIni
);
1641 case SPI_SETDESKWALLPAPER
:
1642 if (!pvParam
|| set_entry( &entry_DESKWALLPAPER
, uiParam
, pvParam
, fWinIni
))
1643 ret
= update_desktop_wallpaper();
1645 case SPI_SETDESKPATTERN
:
1646 if (!pvParam
|| set_entry( &entry_DESKPATTERN
, uiParam
, pvParam
, fWinIni
))
1647 ret
= update_desktop_wallpaper();
1649 case SPI_GETKEYBOARDDELAY
:
1650 ret
= get_entry( &entry_KEYBOARDDELAY
, uiParam
, pvParam
);
1652 case SPI_SETKEYBOARDDELAY
:
1653 ret
= set_entry( &entry_KEYBOARDDELAY
, uiParam
, pvParam
, fWinIni
);
1655 case SPI_ICONVERTICALSPACING
:
1656 if (pvParam
!= NULL
)
1657 ret
= get_entry( &entry_ICONVERTICALSPACING
, uiParam
, pvParam
);
1660 int min_val
= map_to_dpi( 32, GetDpiForSystem() );
1661 ret
= set_entry( &entry_ICONVERTICALSPACING
, max( min_val
, uiParam
), pvParam
, fWinIni
);
1664 case SPI_GETICONTITLEWRAP
:
1665 ret
= get_entry( &entry_ICONTITLEWRAP
, uiParam
, pvParam
);
1667 case SPI_SETICONTITLEWRAP
:
1668 ret
= set_entry( &entry_ICONTITLEWRAP
, uiParam
, pvParam
, fWinIni
);
1670 case SPI_GETMENUDROPALIGNMENT
:
1671 ret
= get_entry( &entry_MENUDROPALIGNMENT
, uiParam
, pvParam
);
1673 case SPI_SETMENUDROPALIGNMENT
:
1674 ret
= set_entry( &entry_MENUDROPALIGNMENT
, uiParam
, pvParam
, fWinIni
);
1676 case SPI_SETDOUBLECLKWIDTH
:
1677 ret
= set_entry( &entry_DOUBLECLKWIDTH
, uiParam
, pvParam
, fWinIni
);
1679 case SPI_SETDOUBLECLKHEIGHT
:
1680 ret
= set_entry( &entry_DOUBLECLKHEIGHT
, uiParam
, pvParam
, fWinIni
);
1682 case SPI_GETICONTITLELOGFONT
:
1683 ret
= get_entry( &entry_ICONTITLELOGFONT
, uiParam
, pvParam
);
1685 case SPI_SETDOUBLECLICKTIME
:
1686 ret
= set_entry( &entry_DOUBLECLICKTIME
, uiParam
, pvParam
, fWinIni
);
1688 case SPI_SETMOUSEBUTTONSWAP
:
1689 ret
= set_entry( &entry_MOUSEBUTTONSWAP
, uiParam
, pvParam
, fWinIni
);
1691 case SPI_SETICONTITLELOGFONT
:
1692 ret
= set_entry( &entry_ICONTITLELOGFONT
, uiParam
, pvParam
, fWinIni
);
1695 case SPI_GETFASTTASKSWITCH
: /* 35 */
1696 if (!pvParam
) return FALSE
;
1697 *(BOOL
*)pvParam
= TRUE
;
1701 case SPI_SETFASTTASKSWITCH
: /* 36 */
1702 /* the action is disabled */
1706 case SPI_SETDRAGFULLWINDOWS
:
1707 ret
= set_entry( &entry_DRAGFULLWINDOWS
, uiParam
, pvParam
, fWinIni
);
1709 case SPI_GETDRAGFULLWINDOWS
:
1710 ret
= get_entry( &entry_DRAGFULLWINDOWS
, uiParam
, pvParam
);
1712 case SPI_GETNONCLIENTMETRICS
:
1714 LPNONCLIENTMETRICSW lpnm
= pvParam
;
1717 if (!pvParam
) return FALSE
;
1719 ret
= get_entry( &entry_BORDER
, 0, &lpnm
->iBorderWidth
) &&
1720 get_entry( &entry_PADDEDBORDERWIDTH
, 0, &padded_border
) &&
1721 get_entry( &entry_SCROLLWIDTH
, 0, &lpnm
->iScrollWidth
) &&
1722 get_entry( &entry_SCROLLHEIGHT
, 0, &lpnm
->iScrollHeight
) &&
1723 get_entry( &entry_CAPTIONWIDTH
, 0, &lpnm
->iCaptionWidth
) &&
1724 get_entry( &entry_CAPTIONHEIGHT
, 0, &lpnm
->iCaptionHeight
) &&
1725 get_entry( &entry_CAPTIONLOGFONT
, 0, &lpnm
->lfCaptionFont
) &&
1726 get_entry( &entry_SMCAPTIONWIDTH
, 0, &lpnm
->iSmCaptionWidth
) &&
1727 get_entry( &entry_SMCAPTIONHEIGHT
, 0, &lpnm
->iSmCaptionHeight
) &&
1728 get_entry( &entry_SMCAPTIONLOGFONT
, 0, &lpnm
->lfSmCaptionFont
) &&
1729 get_entry( &entry_MENUWIDTH
, 0, &lpnm
->iMenuWidth
) &&
1730 get_entry( &entry_MENUHEIGHT
, 0, &lpnm
->iMenuHeight
) &&
1731 get_entry( &entry_MENULOGFONT
, 0, &lpnm
->lfMenuFont
) &&
1732 get_entry( &entry_STATUSLOGFONT
, 0, &lpnm
->lfStatusFont
) &&
1733 get_entry( &entry_MESSAGELOGFONT
, 0, &lpnm
->lfMessageFont
);
1734 lpnm
->iBorderWidth
+= padded_border
;
1735 if (ret
&& lpnm
->cbSize
== sizeof(NONCLIENTMETRICSW
)) lpnm
->iPaddedBorderWidth
= 0;
1736 normalize_nonclientmetrics( lpnm
);
1739 case SPI_SETNONCLIENTMETRICS
:
1741 LPNONCLIENTMETRICSW lpnm
= pvParam
;
1744 if (lpnm
&& (lpnm
->cbSize
== sizeof(NONCLIENTMETRICSW
) ||
1745 lpnm
->cbSize
== FIELD_OFFSET(NONCLIENTMETRICSW
, iPaddedBorderWidth
)))
1747 get_entry( &entry_PADDEDBORDERWIDTH
, 0, &padded_border
);
1749 ret
= set_entry( &entry_BORDER
, lpnm
->iBorderWidth
- padded_border
, NULL
, fWinIni
) &&
1750 set_entry( &entry_SCROLLWIDTH
, lpnm
->iScrollWidth
, NULL
, fWinIni
) &&
1751 set_entry( &entry_SCROLLHEIGHT
, lpnm
->iScrollHeight
, NULL
, fWinIni
) &&
1752 set_entry( &entry_CAPTIONWIDTH
, lpnm
->iCaptionWidth
, NULL
, fWinIni
) &&
1753 set_entry( &entry_CAPTIONHEIGHT
, lpnm
->iCaptionHeight
, NULL
, fWinIni
) &&
1754 set_entry( &entry_SMCAPTIONWIDTH
, lpnm
->iSmCaptionWidth
, NULL
, fWinIni
) &&
1755 set_entry( &entry_SMCAPTIONHEIGHT
, lpnm
->iSmCaptionHeight
, NULL
, fWinIni
) &&
1756 set_entry( &entry_MENUWIDTH
, lpnm
->iMenuWidth
, NULL
, fWinIni
) &&
1757 set_entry( &entry_MENUHEIGHT
, lpnm
->iMenuHeight
, NULL
, fWinIni
) &&
1758 set_entry( &entry_MENULOGFONT
, 0, &lpnm
->lfMenuFont
, fWinIni
) &&
1759 set_entry( &entry_CAPTIONLOGFONT
, 0, &lpnm
->lfCaptionFont
, fWinIni
) &&
1760 set_entry( &entry_SMCAPTIONLOGFONT
, 0, &lpnm
->lfSmCaptionFont
, fWinIni
) &&
1761 set_entry( &entry_STATUSLOGFONT
, 0, &lpnm
->lfStatusFont
, fWinIni
) &&
1762 set_entry( &entry_MESSAGELOGFONT
, 0, &lpnm
->lfMessageFont
, fWinIni
);
1766 case SPI_GETMINIMIZEDMETRICS
:
1768 MINIMIZEDMETRICS
* lpMm
= pvParam
;
1769 if (lpMm
&& lpMm
->cbSize
== sizeof(*lpMm
)) {
1770 ret
= get_entry( &entry_MINWIDTH
, 0, &lpMm
->iWidth
) &&
1771 get_entry( &entry_MINHORZGAP
, 0, &lpMm
->iHorzGap
) &&
1772 get_entry( &entry_MINVERTGAP
, 0, &lpMm
->iVertGap
) &&
1773 get_entry( &entry_MINARRANGE
, 0, &lpMm
->iArrange
);
1774 lpMm
->iWidth
= max( 0, lpMm
->iWidth
);
1775 lpMm
->iHorzGap
= max( 0, lpMm
->iHorzGap
);
1776 lpMm
->iVertGap
= max( 0, lpMm
->iVertGap
);
1777 lpMm
->iArrange
&= 0x0f;
1781 case SPI_SETMINIMIZEDMETRICS
:
1783 MINIMIZEDMETRICS
* lpMm
= pvParam
;
1784 if (lpMm
&& lpMm
->cbSize
== sizeof(*lpMm
))
1785 ret
= set_entry( &entry_MINWIDTH
, max( 0, lpMm
->iWidth
), NULL
, fWinIni
) &&
1786 set_entry( &entry_MINHORZGAP
, max( 0, lpMm
->iHorzGap
), NULL
, fWinIni
) &&
1787 set_entry( &entry_MINVERTGAP
, max( 0, lpMm
->iVertGap
), NULL
, fWinIni
) &&
1788 set_entry( &entry_MINARRANGE
, lpMm
->iArrange
& 0x0f, NULL
, fWinIni
);
1791 case SPI_GETICONMETRICS
:
1793 LPICONMETRICSW lpIcon
= pvParam
;
1794 if(lpIcon
&& lpIcon
->cbSize
== sizeof(*lpIcon
))
1796 ret
= get_entry( &entry_ICONHORIZONTALSPACING
, 0, &lpIcon
->iHorzSpacing
) &&
1797 get_entry( &entry_ICONVERTICALSPACING
, 0, &lpIcon
->iVertSpacing
) &&
1798 get_entry( &entry_ICONTITLEWRAP
, 0, &lpIcon
->iTitleWrap
) &&
1799 get_entry( &entry_ICONTITLELOGFONT
, 0, &lpIcon
->lfFont
);
1803 case SPI_SETICONMETRICS
:
1805 LPICONMETRICSW lpIcon
= pvParam
;
1806 if (lpIcon
&& lpIcon
->cbSize
== sizeof(*lpIcon
))
1807 ret
= set_entry( &entry_ICONVERTICALSPACING
, max(32,lpIcon
->iVertSpacing
), NULL
, fWinIni
) &&
1808 set_entry( &entry_ICONHORIZONTALSPACING
, max(32,lpIcon
->iHorzSpacing
), NULL
, fWinIni
) &&
1809 set_entry( &entry_ICONTITLEWRAP
, lpIcon
->iTitleWrap
, NULL
, fWinIni
) &&
1810 set_entry( &entry_ICONTITLELOGFONT
, 0, &lpIcon
->lfFont
, fWinIni
);
1814 case SPI_SETWORKAREA
: /* 47 WINVER >= 0x400 */
1816 if (!pvParam
) return FALSE
;
1818 spi_idx
= SPI_SETWORKAREA_IDX
;
1819 work_area
= *(RECT
*)pvParam
;
1820 spi_loaded
[spi_idx
] = TRUE
;
1825 case SPI_GETWORKAREA
: /* 48 WINVER >= 0x400 */
1827 if (!pvParam
) return FALSE
;
1829 spi_idx
= SPI_SETWORKAREA_IDX
;
1830 if (!spi_loaded
[spi_idx
])
1832 SetRect( &work_area
, 0, 0,
1833 GetSystemMetrics( SM_CXSCREEN
),
1834 GetSystemMetrics( SM_CYSCREEN
) );
1835 EnumDisplayMonitors( 0, NULL
, enum_monitors
, (LPARAM
)&work_area
);
1836 spi_loaded
[spi_idx
] = TRUE
;
1838 *(RECT
*)pvParam
= work_area
;
1840 TRACE("work area %s\n", wine_dbgstr_rect( &work_area
));
1844 WINE_SPI_FIXME(SPI_SETPENWINDOWS
); /* 49 WINVER >= 0x400 */
1846 case SPI_GETFILTERKEYS
: /* 50 */
1848 LPFILTERKEYS lpFilterKeys
= pvParam
;
1849 WARN("SPI_GETFILTERKEYS not fully implemented\n");
1850 if (lpFilterKeys
&& lpFilterKeys
->cbSize
== sizeof(FILTERKEYS
))
1852 /* Indicate that no FilterKeys feature available */
1853 lpFilterKeys
->dwFlags
= 0;
1854 lpFilterKeys
->iWaitMSec
= 0;
1855 lpFilterKeys
->iDelayMSec
= 0;
1856 lpFilterKeys
->iRepeatMSec
= 0;
1857 lpFilterKeys
->iBounceMSec
= 0;
1862 WINE_SPI_FIXME(SPI_SETFILTERKEYS
); /* 51 */
1864 case SPI_GETTOGGLEKEYS
: /* 52 */
1866 LPTOGGLEKEYS lpToggleKeys
= pvParam
;
1867 WARN("SPI_GETTOGGLEKEYS not fully implemented\n");
1868 if (lpToggleKeys
&& lpToggleKeys
->cbSize
== sizeof(TOGGLEKEYS
))
1870 /* Indicate that no ToggleKeys feature available */
1871 lpToggleKeys
->dwFlags
= 0;
1876 WINE_SPI_FIXME(SPI_SETTOGGLEKEYS
); /* 53 */
1878 case SPI_GETMOUSEKEYS
: /* 54 */
1880 LPMOUSEKEYS lpMouseKeys
= pvParam
;
1881 WARN("SPI_GETMOUSEKEYS not fully implemented\n");
1882 if (lpMouseKeys
&& lpMouseKeys
->cbSize
== sizeof(MOUSEKEYS
))
1884 /* Indicate that no MouseKeys feature available */
1885 lpMouseKeys
->dwFlags
= 0;
1886 lpMouseKeys
->iMaxSpeed
= 360;
1887 lpMouseKeys
->iTimeToMaxSpeed
= 1000;
1888 lpMouseKeys
->iCtrlSpeed
= 0;
1889 lpMouseKeys
->dwReserved1
= 0;
1890 lpMouseKeys
->dwReserved2
= 0;
1895 WINE_SPI_FIXME(SPI_SETMOUSEKEYS
); /* 55 */
1897 case SPI_GETSHOWSOUNDS
:
1898 ret
= get_entry( &entry_SHOWSOUNDS
, uiParam
, pvParam
);
1900 case SPI_SETSHOWSOUNDS
:
1901 ret
= set_entry( &entry_SHOWSOUNDS
, uiParam
, pvParam
, fWinIni
);
1904 case SPI_GETSTICKYKEYS
: /* 58 */
1906 LPSTICKYKEYS lpStickyKeys
= pvParam
;
1907 WARN("SPI_GETSTICKYKEYS not fully implemented\n");
1908 if (lpStickyKeys
&& lpStickyKeys
->cbSize
== sizeof(STICKYKEYS
))
1910 /* Indicate that no StickyKeys feature available */
1911 lpStickyKeys
->dwFlags
= 0;
1916 WINE_SPI_FIXME(SPI_SETSTICKYKEYS
); /* 59 */
1918 case SPI_GETACCESSTIMEOUT
: /* 60 */
1920 LPACCESSTIMEOUT lpAccessTimeout
= pvParam
;
1921 WARN("SPI_GETACCESSTIMEOUT not fully implemented\n");
1922 if (lpAccessTimeout
&& lpAccessTimeout
->cbSize
== sizeof(ACCESSTIMEOUT
))
1924 /* Indicate that no accessibility features timeout is available */
1925 lpAccessTimeout
->dwFlags
= 0;
1926 lpAccessTimeout
->iTimeOutMSec
= 0;
1931 WINE_SPI_FIXME(SPI_SETACCESSTIMEOUT
); /* 61 */
1933 case SPI_GETSERIALKEYS
: /* 62 WINVER >= 0x400 */
1935 LPSERIALKEYSW lpSerialKeysW
= pvParam
;
1936 WARN("SPI_GETSERIALKEYS not fully implemented\n");
1937 if (lpSerialKeysW
&& lpSerialKeysW
->cbSize
== sizeof(SERIALKEYSW
))
1939 /* Indicate that no SerialKeys feature available */
1940 lpSerialKeysW
->dwFlags
= 0;
1941 lpSerialKeysW
->lpszActivePort
= NULL
;
1942 lpSerialKeysW
->lpszPort
= NULL
;
1943 lpSerialKeysW
->iBaudRate
= 0;
1944 lpSerialKeysW
->iPortState
= 0;
1949 WINE_SPI_FIXME(SPI_SETSERIALKEYS
); /* 63 WINVER >= 0x400 */
1951 case SPI_GETSOUNDSENTRY
: /* 64 */
1953 LPSOUNDSENTRYW lpSoundSentryW
= pvParam
;
1954 WARN("SPI_GETSOUNDSENTRY not fully implemented\n");
1955 if (lpSoundSentryW
&& lpSoundSentryW
->cbSize
== sizeof(SOUNDSENTRYW
))
1957 /* Indicate that no SoundSentry feature available */
1958 lpSoundSentryW
->dwFlags
= 0;
1959 lpSoundSentryW
->iFSTextEffect
= 0;
1960 lpSoundSentryW
->iFSTextEffectMSec
= 0;
1961 lpSoundSentryW
->iFSTextEffectColorBits
= 0;
1962 lpSoundSentryW
->iFSGrafEffect
= 0;
1963 lpSoundSentryW
->iFSGrafEffectMSec
= 0;
1964 lpSoundSentryW
->iFSGrafEffectColor
= 0;
1965 lpSoundSentryW
->iWindowsEffect
= 0;
1966 lpSoundSentryW
->iWindowsEffectMSec
= 0;
1967 lpSoundSentryW
->lpszWindowsEffectDLL
= 0;
1968 lpSoundSentryW
->iWindowsEffectOrdinal
= 0;
1973 WINE_SPI_FIXME(SPI_SETSOUNDSENTRY
); /* 65 */
1975 case SPI_GETHIGHCONTRAST
: /* 66 WINVER >= 0x400 */
1977 LPHIGHCONTRASTW lpHighContrastW
= pvParam
;
1978 WARN("SPI_GETHIGHCONTRAST not fully implemented\n");
1979 if (lpHighContrastW
&& lpHighContrastW
->cbSize
== sizeof(HIGHCONTRASTW
))
1981 /* Indicate that no high contrast feature available */
1982 lpHighContrastW
->dwFlags
= 0;
1983 lpHighContrastW
->lpszDefaultScheme
= NULL
;
1988 WINE_SPI_FIXME(SPI_SETHIGHCONTRAST
); /* 67 WINVER >= 0x400 */
1990 case SPI_GETKEYBOARDPREF
:
1991 ret
= get_entry( &entry_KEYBOARDPREF
, uiParam
, pvParam
);
1993 case SPI_SETKEYBOARDPREF
:
1994 ret
= set_entry( &entry_KEYBOARDPREF
, uiParam
, pvParam
, fWinIni
);
1996 case SPI_GETSCREENREADER
:
1997 ret
= get_entry( &entry_SCREENREADER
, uiParam
, pvParam
);
1999 case SPI_SETSCREENREADER
:
2000 ret
= set_entry( &entry_SCREENREADER
, uiParam
, pvParam
, fWinIni
);
2003 case SPI_GETANIMATION
: /* 72 WINVER >= 0x400 */
2005 LPANIMATIONINFO lpAnimInfo
= pvParam
;
2007 /* Tell it "disabled" */
2008 if (lpAnimInfo
&& lpAnimInfo
->cbSize
== sizeof(ANIMATIONINFO
))
2010 lpAnimInfo
->iMinAnimate
= 0; /* Minimise and restore animation is disabled (nonzero == enabled) */
2015 WINE_SPI_WARN(SPI_SETANIMATION
); /* 73 WINVER >= 0x400 */
2017 case SPI_GETFONTSMOOTHING
:
2018 ret
= get_entry( &entry_FONTSMOOTHING
, uiParam
, pvParam
);
2019 if (ret
) *(UINT
*)pvParam
= (*(UINT
*)pvParam
!= 0);
2021 case SPI_SETFONTSMOOTHING
:
2022 uiParam
= uiParam
? 2 : 0; /* Win NT4/2k/XP behavior */
2023 ret
= set_entry( &entry_FONTSMOOTHING
, uiParam
, pvParam
, fWinIni
);
2025 case SPI_SETDRAGWIDTH
:
2026 ret
= set_entry( &entry_DRAGWIDTH
, uiParam
, pvParam
, fWinIni
);
2028 case SPI_SETDRAGHEIGHT
:
2029 ret
= set_entry( &entry_DRAGHEIGHT
, uiParam
, pvParam
, fWinIni
);
2032 WINE_SPI_FIXME(SPI_SETHANDHELD
); /* 78 WINVER >= 0x400 */
2034 WINE_SPI_FIXME(SPI_GETLOWPOWERTIMEOUT
); /* 79 WINVER >= 0x400 */
2035 WINE_SPI_FIXME(SPI_GETPOWEROFFTIMEOUT
); /* 80 WINVER >= 0x400 */
2036 WINE_SPI_FIXME(SPI_SETLOWPOWERTIMEOUT
); /* 81 WINVER >= 0x400 */
2037 WINE_SPI_FIXME(SPI_SETPOWEROFFTIMEOUT
); /* 82 WINVER >= 0x400 */
2039 case SPI_GETLOWPOWERACTIVE
:
2040 ret
= get_entry( &entry_LOWPOWERACTIVE
, uiParam
, pvParam
);
2042 case SPI_SETLOWPOWERACTIVE
:
2043 ret
= set_entry( &entry_LOWPOWERACTIVE
, uiParam
, pvParam
, fWinIni
);
2045 case SPI_GETPOWEROFFACTIVE
:
2046 ret
= get_entry( &entry_POWEROFFACTIVE
, uiParam
, pvParam
);
2048 case SPI_SETPOWEROFFACTIVE
:
2049 ret
= set_entry( &entry_POWEROFFACTIVE
, uiParam
, pvParam
, fWinIni
);
2052 WINE_SPI_FIXME(SPI_SETCURSORS
); /* 87 WINVER >= 0x400 */
2053 WINE_SPI_FIXME(SPI_SETICONS
); /* 88 WINVER >= 0x400 */
2055 case SPI_GETDEFAULTINPUTLANG
: /* 89 WINVER >= 0x400 */
2056 ret
= GetKeyboardLayout(0) != 0;
2059 WINE_SPI_FIXME(SPI_SETDEFAULTINPUTLANG
); /* 90 WINVER >= 0x400 */
2061 WINE_SPI_FIXME(SPI_SETLANGTOGGLE
); /* 91 WINVER >= 0x400 */
2063 case SPI_GETWINDOWSEXTENSION
: /* 92 WINVER >= 0x400 */
2064 WARN("pretend no support for Win9x Plus! for now.\n");
2065 ret
= FALSE
; /* yes, this is the result value */
2067 case SPI_SETMOUSETRAILS
:
2068 ret
= set_entry( &entry_MOUSETRAILS
, uiParam
, pvParam
, fWinIni
);
2070 case SPI_GETMOUSETRAILS
:
2071 ret
= get_entry( &entry_MOUSETRAILS
, uiParam
, pvParam
);
2073 case SPI_GETSNAPTODEFBUTTON
:
2074 ret
= get_entry( &entry_SNAPTODEFBUTTON
, uiParam
, pvParam
);
2076 case SPI_SETSNAPTODEFBUTTON
:
2077 ret
= set_entry( &entry_SNAPTODEFBUTTON
, uiParam
, pvParam
, fWinIni
);
2079 case SPI_SETSCREENSAVERRUNNING
:
2080 ret
= set_entry( &entry_SCREENSAVERRUNNING
, uiParam
, pvParam
, fWinIni
);
2082 case SPI_GETMOUSEHOVERWIDTH
:
2083 ret
= get_entry( &entry_MOUSEHOVERWIDTH
, uiParam
, pvParam
);
2085 case SPI_SETMOUSEHOVERWIDTH
:
2086 ret
= set_entry( &entry_MOUSEHOVERWIDTH
, uiParam
, pvParam
, fWinIni
);
2088 case SPI_GETMOUSEHOVERHEIGHT
:
2089 ret
= get_entry( &entry_MOUSEHOVERHEIGHT
, uiParam
, pvParam
);
2091 case SPI_SETMOUSEHOVERHEIGHT
:
2092 ret
= set_entry( &entry_MOUSEHOVERHEIGHT
, uiParam
, pvParam
, fWinIni
);
2094 case SPI_GETMOUSEHOVERTIME
:
2095 ret
= get_entry( &entry_MOUSEHOVERTIME
, uiParam
, pvParam
);
2097 case SPI_SETMOUSEHOVERTIME
:
2098 ret
= set_entry( &entry_MOUSEHOVERTIME
, uiParam
, pvParam
, fWinIni
);
2100 case SPI_GETWHEELSCROLLLINES
:
2101 ret
= get_entry( &entry_WHEELSCROLLLINES
, uiParam
, pvParam
);
2103 case SPI_SETWHEELSCROLLLINES
:
2104 ret
= set_entry( &entry_WHEELSCROLLLINES
, uiParam
, pvParam
, fWinIni
);
2106 case SPI_GETMENUSHOWDELAY
:
2107 ret
= get_entry( &entry_MENUSHOWDELAY
, uiParam
, pvParam
);
2109 case SPI_SETMENUSHOWDELAY
:
2110 ret
= set_entry( &entry_MENUSHOWDELAY
, uiParam
, pvParam
, fWinIni
);
2112 case SPI_GETWHEELSCROLLCHARS
:
2113 ret
= get_entry( &entry_WHEELSCROLLCHARS
, uiParam
, pvParam
);
2115 case SPI_SETWHEELSCROLLCHARS
:
2116 ret
= set_entry( &entry_WHEELSCROLLCHARS
, uiParam
, pvParam
, fWinIni
);
2119 WINE_SPI_FIXME(SPI_GETSHOWIMEUI
); /* 110 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
2120 WINE_SPI_FIXME(SPI_SETSHOWIMEUI
); /* 111 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */
2122 case SPI_GETMOUSESPEED
:
2123 ret
= get_entry( &entry_MOUSESPEED
, uiParam
, pvParam
);
2125 case SPI_SETMOUSESPEED
:
2126 ret
= set_entry( &entry_MOUSESPEED
, uiParam
, pvParam
, fWinIni
);
2128 case SPI_GETSCREENSAVERRUNNING
:
2129 ret
= get_entry( &entry_SCREENSAVERRUNNING
, uiParam
, pvParam
);
2131 case SPI_GETDESKWALLPAPER
:
2132 ret
= get_entry( &entry_DESKWALLPAPER
, uiParam
, pvParam
);
2134 case SPI_GETACTIVEWINDOWTRACKING
:
2135 ret
= get_entry( &entry_ACTIVEWINDOWTRACKING
, uiParam
, pvParam
);
2137 case SPI_SETACTIVEWINDOWTRACKING
:
2138 ret
= set_entry( &entry_ACTIVEWINDOWTRACKING
, uiParam
, pvParam
, fWinIni
);
2140 case SPI_GETMENUANIMATION
:
2141 ret
= get_entry( &entry_MENUANIMATION
, uiParam
, pvParam
);
2143 case SPI_SETMENUANIMATION
:
2144 ret
= set_entry( &entry_MENUANIMATION
, uiParam
, pvParam
, fWinIni
);
2146 case SPI_GETCOMBOBOXANIMATION
:
2147 ret
= get_entry( &entry_COMBOBOXANIMATION
, uiParam
, pvParam
);
2149 case SPI_SETCOMBOBOXANIMATION
:
2150 ret
= set_entry( &entry_COMBOBOXANIMATION
, uiParam
, pvParam
, fWinIni
);
2152 case SPI_GETLISTBOXSMOOTHSCROLLING
:
2153 ret
= get_entry( &entry_LISTBOXSMOOTHSCROLLING
, uiParam
, pvParam
);
2155 case SPI_SETLISTBOXSMOOTHSCROLLING
:
2156 ret
= set_entry( &entry_LISTBOXSMOOTHSCROLLING
, uiParam
, pvParam
, fWinIni
);
2158 case SPI_GETGRADIENTCAPTIONS
:
2159 ret
= get_entry( &entry_GRADIENTCAPTIONS
, uiParam
, pvParam
);
2161 case SPI_SETGRADIENTCAPTIONS
:
2162 ret
= set_entry( &entry_GRADIENTCAPTIONS
, uiParam
, pvParam
, fWinIni
);
2164 case SPI_GETKEYBOARDCUES
:
2165 ret
= get_entry( &entry_KEYBOARDCUES
, uiParam
, pvParam
);
2167 case SPI_SETKEYBOARDCUES
:
2168 ret
= set_entry( &entry_KEYBOARDCUES
, uiParam
, pvParam
, fWinIni
);
2170 case SPI_GETACTIVEWNDTRKZORDER
:
2171 ret
= get_entry( &entry_ACTIVEWNDTRKZORDER
, uiParam
, pvParam
);
2173 case SPI_SETACTIVEWNDTRKZORDER
:
2174 ret
= set_entry( &entry_ACTIVEWNDTRKZORDER
, uiParam
, pvParam
, fWinIni
);
2176 case SPI_GETHOTTRACKING
:
2177 ret
= get_entry( &entry_HOTTRACKING
, uiParam
, pvParam
);
2179 case SPI_SETHOTTRACKING
:
2180 ret
= set_entry( &entry_HOTTRACKING
, uiParam
, pvParam
, fWinIni
);
2182 case SPI_GETMENUFADE
:
2183 ret
= get_entry( &entry_MENUFADE
, uiParam
, pvParam
);
2185 case SPI_SETMENUFADE
:
2186 ret
= set_entry( &entry_MENUFADE
, uiParam
, pvParam
, fWinIni
);
2188 case SPI_GETSELECTIONFADE
:
2189 ret
= get_entry( &entry_SELECTIONFADE
, uiParam
, pvParam
);
2191 case SPI_SETSELECTIONFADE
:
2192 ret
= set_entry( &entry_SELECTIONFADE
, uiParam
, pvParam
, fWinIni
);
2194 case SPI_GETTOOLTIPANIMATION
:
2195 ret
= get_entry( &entry_TOOLTIPANIMATION
, uiParam
, pvParam
);
2197 case SPI_SETTOOLTIPANIMATION
:
2198 ret
= set_entry( &entry_TOOLTIPANIMATION
, uiParam
, pvParam
, fWinIni
);
2200 case SPI_GETTOOLTIPFADE
:
2201 ret
= get_entry( &entry_TOOLTIPFADE
, uiParam
, pvParam
);
2203 case SPI_SETTOOLTIPFADE
:
2204 ret
= set_entry( &entry_TOOLTIPFADE
, uiParam
, pvParam
, fWinIni
);
2206 case SPI_GETCURSORSHADOW
:
2207 ret
= get_entry( &entry_CURSORSHADOW
, uiParam
, pvParam
);
2209 case SPI_SETCURSORSHADOW
:
2210 ret
= set_entry( &entry_CURSORSHADOW
, uiParam
, pvParam
, fWinIni
);
2212 case SPI_GETMOUSESONAR
:
2213 ret
= get_entry( &entry_MOUSESONAR
, uiParam
, pvParam
);
2215 case SPI_SETMOUSESONAR
:
2216 ret
= set_entry( &entry_MOUSESONAR
, uiParam
, pvParam
, fWinIni
);
2218 case SPI_GETMOUSECLICKLOCK
:
2219 ret
= get_entry( &entry_MOUSECLICKLOCK
, uiParam
, pvParam
);
2221 case SPI_SETMOUSECLICKLOCK
:
2222 ret
= set_entry( &entry_MOUSECLICKLOCK
, uiParam
, pvParam
, fWinIni
);
2224 case SPI_GETMOUSEVANISH
:
2225 ret
= get_entry( &entry_MOUSEVANISH
, uiParam
, pvParam
);
2227 case SPI_SETMOUSEVANISH
:
2228 ret
= set_entry( &entry_MOUSEVANISH
, uiParam
, pvParam
, fWinIni
);
2230 case SPI_GETFLATMENU
:
2231 ret
= get_entry( &entry_FLATMENU
, uiParam
, pvParam
);
2233 case SPI_SETFLATMENU
:
2234 ret
= set_entry( &entry_FLATMENU
, uiParam
, pvParam
, fWinIni
);
2236 case SPI_GETDROPSHADOW
:
2237 ret
= get_entry( &entry_DROPSHADOW
, uiParam
, pvParam
);
2239 case SPI_SETDROPSHADOW
:
2240 ret
= set_entry( &entry_DROPSHADOW
, uiParam
, pvParam
, fWinIni
);
2242 case SPI_GETBLOCKSENDINPUTRESETS
:
2243 ret
= get_entry( &entry_BLOCKSENDINPUTRESETS
, uiParam
, pvParam
);
2245 case SPI_SETBLOCKSENDINPUTRESETS
:
2246 ret
= set_entry( &entry_BLOCKSENDINPUTRESETS
, uiParam
, pvParam
, fWinIni
);
2248 case SPI_GETUIEFFECTS
:
2249 ret
= get_entry( &entry_UIEFFECTS
, uiParam
, pvParam
);
2251 case SPI_SETUIEFFECTS
:
2252 /* FIXME: this probably should mask other UI effect values when unset */
2253 ret
= set_entry( &entry_UIEFFECTS
, uiParam
, pvParam
, fWinIni
);
2255 case SPI_GETDISABLEOVERLAPPEDCONTENT
:
2256 ret
= get_entry( &entry_DISABLEOVERLAPPEDCONTENT
, uiParam
, pvParam
);
2258 case SPI_SETDISABLEOVERLAPPEDCONTENT
:
2259 ret
= set_entry( &entry_DISABLEOVERLAPPEDCONTENT
, uiParam
, pvParam
, fWinIni
);
2261 case SPI_GETCLIENTAREAANIMATION
:
2262 ret
= get_entry( &entry_CLIENTAREAANIMATION
, uiParam
, pvParam
);
2264 case SPI_SETCLIENTAREAANIMATION
:
2265 ret
= set_entry( &entry_CLIENTAREAANIMATION
, uiParam
, pvParam
, fWinIni
);
2267 case SPI_GETCLEARTYPE
:
2268 ret
= get_entry( &entry_CLEARTYPE
, uiParam
, pvParam
);
2270 case SPI_SETCLEARTYPE
:
2271 ret
= set_entry( &entry_CLEARTYPE
, uiParam
, pvParam
, fWinIni
);
2273 case SPI_GETSPEECHRECOGNITION
:
2274 ret
= get_entry( &entry_SPEECHRECOGNITION
, uiParam
, pvParam
);
2276 case SPI_SETSPEECHRECOGNITION
:
2277 ret
= set_entry( &entry_SPEECHRECOGNITION
, uiParam
, pvParam
, fWinIni
);
2279 case SPI_GETFOREGROUNDLOCKTIMEOUT
:
2280 ret
= get_entry( &entry_FOREGROUNDLOCKTIMEOUT
, uiParam
, pvParam
);
2282 case SPI_SETFOREGROUNDLOCKTIMEOUT
:
2283 /* FIXME: this should check that the calling thread
2284 * is able to change the foreground window */
2285 ret
= set_entry( &entry_FOREGROUNDLOCKTIMEOUT
, uiParam
, pvParam
, fWinIni
);
2287 case SPI_GETACTIVEWNDTRKTIMEOUT
:
2288 ret
= get_entry( &entry_ACTIVEWNDTRKTIMEOUT
, uiParam
, pvParam
);
2290 case SPI_SETACTIVEWNDTRKTIMEOUT
:
2291 ret
= get_entry( &entry_ACTIVEWNDTRKTIMEOUT
, uiParam
, pvParam
);
2293 case SPI_GETFOREGROUNDFLASHCOUNT
:
2294 ret
= get_entry( &entry_FOREGROUNDFLASHCOUNT
, uiParam
, pvParam
);
2296 case SPI_SETFOREGROUNDFLASHCOUNT
:
2297 ret
= set_entry( &entry_FOREGROUNDFLASHCOUNT
, uiParam
, pvParam
, fWinIni
);
2299 case SPI_GETCARETWIDTH
:
2300 ret
= get_entry( &entry_CARETWIDTH
, uiParam
, pvParam
);
2302 case SPI_SETCARETWIDTH
:
2303 ret
= set_entry( &entry_CARETWIDTH
, uiParam
, pvParam
, fWinIni
);
2305 case SPI_GETMOUSECLICKLOCKTIME
:
2306 ret
= get_entry( &entry_MOUSECLICKLOCKTIME
, uiParam
, pvParam
);
2308 case SPI_SETMOUSECLICKLOCKTIME
:
2309 ret
= set_entry( &entry_MOUSECLICKLOCKTIME
, uiParam
, pvParam
, fWinIni
);
2311 case SPI_GETFONTSMOOTHINGTYPE
:
2312 ret
= get_entry( &entry_FONTSMOOTHINGTYPE
, uiParam
, pvParam
);
2314 case SPI_SETFONTSMOOTHINGTYPE
:
2315 ret
= set_entry( &entry_FONTSMOOTHINGTYPE
, uiParam
, pvParam
, fWinIni
);
2317 case SPI_GETFONTSMOOTHINGCONTRAST
:
2318 ret
= get_entry( &entry_FONTSMOOTHINGCONTRAST
, uiParam
, pvParam
);
2320 case SPI_SETFONTSMOOTHINGCONTRAST
:
2321 ret
= set_entry( &entry_FONTSMOOTHINGCONTRAST
, uiParam
, pvParam
, fWinIni
);
2323 case SPI_GETFOCUSBORDERWIDTH
:
2324 ret
= get_entry( &entry_FOCUSBORDERWIDTH
, uiParam
, pvParam
);
2326 case SPI_GETFOCUSBORDERHEIGHT
:
2327 ret
= get_entry( &entry_FOCUSBORDERHEIGHT
, uiParam
, pvParam
);
2329 case SPI_SETFOCUSBORDERWIDTH
:
2330 ret
= set_entry( &entry_FOCUSBORDERWIDTH
, uiParam
, pvParam
, fWinIni
);
2332 case SPI_SETFOCUSBORDERHEIGHT
:
2333 ret
= set_entry( &entry_FOCUSBORDERHEIGHT
, uiParam
, pvParam
, fWinIni
);
2335 case SPI_GETFONTSMOOTHINGORIENTATION
:
2336 ret
= get_entry( &entry_FONTSMOOTHINGORIENTATION
, uiParam
, pvParam
);
2338 case SPI_SETFONTSMOOTHINGORIENTATION
:
2339 ret
= set_entry( &entry_FONTSMOOTHINGORIENTATION
, uiParam
, pvParam
, fWinIni
);
2343 FIXME( "Unknown action: %u\n", uiAction
);
2344 SetLastError( ERROR_INVALID_SPI_VALUE
);
2350 SYSPARAMS_NotifyChange( uiAction
, fWinIni
);
2351 TRACE("(%u, %u, %p, %u) ret %d\n",
2352 uiAction
, uiParam
, pvParam
, fWinIni
, ret
);
2355 #undef WINE_SPI_FIXME
2356 #undef WINE_SPI_WARN
2360 /***********************************************************************
2361 * SystemParametersInfoA (USER32.@)
2363 BOOL WINAPI
SystemParametersInfoA( UINT uiAction
, UINT uiParam
,
2364 PVOID pvParam
, UINT fuWinIni
)
2368 TRACE("(%u, %u, %p, %u)\n", uiAction
, uiParam
, pvParam
, fuWinIni
);
2372 case SPI_SETDESKWALLPAPER
: /* 20 */
2373 case SPI_SETDESKPATTERN
: /* 21 */
2377 if (!MultiByteToWideChar( CP_ACP
, 0, pvParam
, -1, buffer
, ARRAY_SIZE( buffer
)))
2378 buffer
[ARRAY_SIZE(buffer
)-1] = 0;
2379 ret
= SystemParametersInfoW( uiAction
, uiParam
, pvParam
? buffer
: NULL
, fuWinIni
);
2383 case SPI_GETICONTITLELOGFONT
: /* 31 */
2386 ret
= SystemParametersInfoW( uiAction
, uiParam
, pvParam
? &tmp
: NULL
, fuWinIni
);
2388 SYSPARAMS_LogFont32WTo32A( &tmp
, pvParam
);
2392 case SPI_GETNONCLIENTMETRICS
: /* 41 WINVER >= 0x400 */
2394 NONCLIENTMETRICSW tmp
;
2395 LPNONCLIENTMETRICSA lpnmA
= pvParam
;
2396 if (lpnmA
&& (lpnmA
->cbSize
== sizeof(NONCLIENTMETRICSA
) ||
2397 lpnmA
->cbSize
== FIELD_OFFSET(NONCLIENTMETRICSA
, iPaddedBorderWidth
)))
2399 tmp
.cbSize
= sizeof(NONCLIENTMETRICSW
);
2400 ret
= SystemParametersInfoW( uiAction
, uiParam
, &tmp
, fuWinIni
);
2402 SYSPARAMS_NonClientMetrics32WTo32A( &tmp
, lpnmA
);
2409 case SPI_SETNONCLIENTMETRICS
: /* 42 WINVER >= 0x400 */
2411 NONCLIENTMETRICSW tmp
;
2412 LPNONCLIENTMETRICSA lpnmA
= pvParam
;
2413 if (lpnmA
&& (lpnmA
->cbSize
== sizeof(NONCLIENTMETRICSA
) ||
2414 lpnmA
->cbSize
== FIELD_OFFSET(NONCLIENTMETRICSA
, iPaddedBorderWidth
)))
2416 tmp
.cbSize
= sizeof(NONCLIENTMETRICSW
);
2417 SYSPARAMS_NonClientMetrics32ATo32W( lpnmA
, &tmp
);
2418 ret
= SystemParametersInfoW( uiAction
, uiParam
, &tmp
, fuWinIni
);
2425 case SPI_GETICONMETRICS
: /* 45 WINVER >= 0x400 */
2428 LPICONMETRICSA lpimA
= pvParam
;
2429 if (lpimA
&& lpimA
->cbSize
== sizeof(ICONMETRICSA
))
2431 tmp
.cbSize
= sizeof(ICONMETRICSW
);
2432 ret
= SystemParametersInfoW( uiAction
, uiParam
, &tmp
, fuWinIni
);
2435 lpimA
->iHorzSpacing
= tmp
.iHorzSpacing
;
2436 lpimA
->iVertSpacing
= tmp
.iVertSpacing
;
2437 lpimA
->iTitleWrap
= tmp
.iTitleWrap
;
2438 SYSPARAMS_LogFont32WTo32A( &tmp
.lfFont
, &lpimA
->lfFont
);
2446 case SPI_SETICONMETRICS
: /* 46 WINVER >= 0x400 */
2449 LPICONMETRICSA lpimA
= pvParam
;
2450 if (lpimA
&& lpimA
->cbSize
== sizeof(ICONMETRICSA
))
2452 tmp
.cbSize
= sizeof(ICONMETRICSW
);
2453 tmp
.iHorzSpacing
= lpimA
->iHorzSpacing
;
2454 tmp
.iVertSpacing
= lpimA
->iVertSpacing
;
2455 tmp
.iTitleWrap
= lpimA
->iTitleWrap
;
2456 SYSPARAMS_LogFont32ATo32W( &lpimA
->lfFont
, &tmp
.lfFont
);
2457 ret
= SystemParametersInfoW( uiAction
, uiParam
, &tmp
, fuWinIni
);
2464 case SPI_GETHIGHCONTRAST
: /* 66 WINVER >= 0x400 */
2467 LPHIGHCONTRASTA lphcA
= pvParam
;
2468 if (lphcA
&& lphcA
->cbSize
== sizeof(HIGHCONTRASTA
))
2470 tmp
.cbSize
= sizeof(HIGHCONTRASTW
);
2471 ret
= SystemParametersInfoW( uiAction
, uiParam
, &tmp
, fuWinIni
);
2474 lphcA
->dwFlags
= tmp
.dwFlags
;
2475 lphcA
->lpszDefaultScheme
= NULL
; /* FIXME? */
2483 case SPI_GETDESKWALLPAPER
: /* 115 */
2485 WCHAR buffer
[MAX_PATH
];
2486 ret
= (SystemParametersInfoW( SPI_GETDESKWALLPAPER
, uiParam
, buffer
, fuWinIni
) &&
2487 WideCharToMultiByte(CP_ACP
, 0, buffer
, -1, pvParam
, uiParam
, NULL
, NULL
));
2492 ret
= SystemParametersInfoW( uiAction
, uiParam
, pvParam
, fuWinIni
);
2499 /***********************************************************************
2500 * GetSystemMetrics (USER32.@)
2502 INT WINAPI
GetSystemMetrics( INT index
)
2504 NONCLIENTMETRICSW ncm
;
2505 MINIMIZEDMETRICS mm
;
2510 /* some metrics are dynamic */
2514 hdc
= get_display_dc();
2515 ret
= GetDeviceCaps( hdc
, HORZRES
);
2516 release_display_dc( hdc
);
2519 hdc
= get_display_dc();
2520 ret
= GetDeviceCaps( hdc
, VERTRES
);
2521 release_display_dc( hdc
);
2525 ncm
.cbSize
= sizeof(ncm
);
2526 SystemParametersInfoW( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0 );
2527 return ncm
.iScrollWidth
;
2529 ncm
.cbSize
= sizeof(ncm
);
2530 SystemParametersInfoW( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0 );
2531 return ncm
.iCaptionHeight
+ 1;
2534 /* SM_C{X,Y}BORDER always returns 1 regardless of 'BorderWidth' value in registry */
2543 ncm
.cbSize
= sizeof(ncm
);
2544 SystemParametersInfoW( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0 );
2545 return ncm
.iScrollHeight
;
2548 return map_to_dpi( 32, GetDpiForSystem() );
2551 ret
= map_to_dpi( 32, GetDpiForSystem() );
2552 if (ret
>= 64) return 64;
2553 if (ret
>= 48) return 48;
2556 ncm
.cbSize
= sizeof(ncm
);
2557 SystemParametersInfoW( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0 );
2558 return ncm
.iMenuHeight
+ 1;
2559 case SM_CXFULLSCREEN
:
2560 /* see the remark for SM_CXMAXIMIZED, at least this formulation is
2562 return GetSystemMetrics( SM_CXMAXIMIZED
) - 2 * GetSystemMetrics( SM_CXFRAME
);
2563 case SM_CYFULLSCREEN
:
2564 /* see the remark for SM_CYMAXIMIZED, at least this formulation is
2566 return GetSystemMetrics( SM_CYMAXIMIZED
) - GetSystemMetrics( SM_CYMIN
);
2567 case SM_CYKANJIWINDOW
:
2569 case SM_MOUSEPRESENT
:
2574 get_entry( &entry_MOUSEBUTTONSWAP
, 0, &ret
);
2582 ncm
.cbSize
= sizeof(ncm
);
2583 SystemParametersInfoW( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0 );
2584 hdc
= get_display_dc();
2585 get_text_metr_size( hdc
, &ncm
.lfCaptionFont
, NULL
, &ret
);
2586 release_display_dc( hdc
);
2587 return 3 * ncm
.iCaptionWidth
+ ncm
.iCaptionHeight
+ 4 * ret
+ 2 * GetSystemMetrics(SM_CXFRAME
) + 4;
2589 return GetSystemMetrics( SM_CYCAPTION
) + 2 * GetSystemMetrics( SM_CYFRAME
);
2591 ncm
.cbSize
= sizeof(ncm
);
2592 SystemParametersInfoW( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0 );
2593 return ncm
.iCaptionWidth
;
2595 ncm
.cbSize
= sizeof(ncm
);
2596 SystemParametersInfoW( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0 );
2597 return ncm
.iCaptionHeight
;
2599 ncm
.cbSize
= sizeof(ncm
);
2600 SystemParametersInfoW( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0 );
2601 return GetSystemMetrics(SM_CXDLGFRAME
) + ncm
.iBorderWidth
;
2603 ncm
.cbSize
= sizeof(ncm
);
2604 SystemParametersInfoW( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0 );
2605 return GetSystemMetrics(SM_CYDLGFRAME
) + ncm
.iBorderWidth
;
2607 return GetSystemMetrics(SM_CXMIN
);
2609 return GetSystemMetrics(SM_CYMIN
);
2610 case SM_CXDOUBLECLK
:
2611 get_entry( &entry_DOUBLECLKWIDTH
, 0, &ret
);
2613 case SM_CYDOUBLECLK
:
2614 get_entry( &entry_DOUBLECLKHEIGHT
, 0, &ret
);
2616 case SM_CXICONSPACING
:
2617 im
.cbSize
= sizeof(im
);
2618 SystemParametersInfoW( SPI_GETICONMETRICS
, sizeof(im
), &im
, 0 );
2619 return im
.iHorzSpacing
;
2620 case SM_CYICONSPACING
:
2621 im
.cbSize
= sizeof(im
);
2622 SystemParametersInfoW( SPI_GETICONMETRICS
, sizeof(im
), &im
, 0 );
2623 return im
.iVertSpacing
;
2624 case SM_MENUDROPALIGNMENT
:
2625 SystemParametersInfoW( SPI_GETMENUDROPALIGNMENT
, 0, &ret
, 0 );
2629 case SM_DBCSENABLED
:
2632 GetCPInfo( CP_ACP
, &cpinfo
);
2633 return (cpinfo
.MaxCharSize
> 1);
2635 case SM_CMOUSEBUTTONS
:
2640 return GetSystemMetrics(SM_CXBORDER
) + 1;
2642 return GetSystemMetrics(SM_CYBORDER
) + 1;
2643 case SM_CXMINSPACING
:
2644 mm
.cbSize
= sizeof(mm
);
2645 SystemParametersInfoW( SPI_GETMINIMIZEDMETRICS
, sizeof(mm
), &mm
, 0 );
2646 return GetSystemMetrics(SM_CXMINIMIZED
) + mm
.iHorzGap
;
2647 case SM_CYMINSPACING
:
2648 mm
.cbSize
= sizeof(mm
);
2649 SystemParametersInfoW( SPI_GETMINIMIZEDMETRICS
, sizeof(mm
), &mm
, 0 );
2650 return GetSystemMetrics(SM_CYMINIMIZED
) + mm
.iVertGap
;
2653 return map_to_dpi( 16, GetDpiForSystem() ) & ~1;
2654 case SM_CYSMCAPTION
:
2655 ncm
.cbSize
= sizeof(ncm
);
2656 SystemParametersInfoW( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0 );
2657 return ncm
.iSmCaptionHeight
+ 1;
2659 ncm
.cbSize
= sizeof(ncm
);
2660 SystemParametersInfoW( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0 );
2661 return ncm
.iSmCaptionWidth
;
2663 ncm
.cbSize
= sizeof(ncm
);
2664 SystemParametersInfoW( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0 );
2665 return ncm
.iSmCaptionHeight
;
2667 ncm
.cbSize
= sizeof(ncm
);
2668 SystemParametersInfoW( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0 );
2669 return ncm
.iMenuWidth
;
2671 ncm
.cbSize
= sizeof(ncm
);
2672 SystemParametersInfoW( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0 );
2673 return ncm
.iMenuHeight
;
2675 mm
.cbSize
= sizeof(mm
);
2676 SystemParametersInfoW( SPI_GETMINIMIZEDMETRICS
, sizeof(mm
), &mm
, 0 );
2678 case SM_CXMINIMIZED
:
2679 mm
.cbSize
= sizeof(mm
);
2680 SystemParametersInfoW( SPI_GETMINIMIZEDMETRICS
, sizeof(mm
), &mm
, 0 );
2681 return mm
.iWidth
+ 6;
2682 case SM_CYMINIMIZED
:
2683 ncm
.cbSize
= sizeof(ncm
);
2684 SystemParametersInfoW( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0 );
2685 return ncm
.iCaptionHeight
+ 6;
2687 return GetSystemMetrics(SM_CXVIRTUALSCREEN
) + 4 + 2 * GetSystemMetrics(SM_CXFRAME
);
2689 return GetSystemMetrics(SM_CYVIRTUALSCREEN
) + 4 + 2 * GetSystemMetrics(SM_CYFRAME
);
2690 case SM_CXMAXIMIZED
:
2691 /* FIXME: subtract the width of any vertical application toolbars*/
2692 return GetSystemMetrics(SM_CXSCREEN
) + 2 * GetSystemMetrics(SM_CXFRAME
);
2693 case SM_CYMAXIMIZED
:
2694 /* FIXME: subtract the width of any horizontal application toolbars*/
2695 return GetSystemMetrics(SM_CYSCREEN
) + 2 * GetSystemMetrics(SM_CYCAPTION
);
2697 return 3; /* FIXME */
2699 return 0; /* 0 = ok, 1 = failsafe, 2 = failsafe + network */
2701 get_entry( &entry_DRAGWIDTH
, 0, &ret
);
2704 get_entry( &entry_DRAGHEIGHT
, 0, &ret
);
2707 get_entry( &entry_SHOWSOUNDS
, 0, &ret
);
2709 case SM_CXMENUCHECK
:
2710 case SM_CYMENUCHECK
:
2713 ncm
.cbSize
= sizeof(ncm
);
2714 SystemParametersInfoW( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0 );
2715 hdc
= get_display_dc();
2716 get_text_metr_size( hdc
, &ncm
.lfMenuFont
, &tm
, NULL
);
2717 release_display_dc( hdc
);
2718 return tm
.tmHeight
<= 0 ? 13 : ((tm
.tmHeight
+ tm
.tmExternalLeading
+ 1) / 2) * 2 - 1;
2720 case SM_SLOWMACHINE
:
2721 return 0; /* Never true */
2722 case SM_MIDEASTENABLED
:
2723 return 0; /* FIXME */
2724 case SM_MOUSEWHEELPRESENT
:
2726 case SM_XVIRTUALSCREEN
:
2728 RECT rect
= get_virtual_screen_rect();
2731 case SM_YVIRTUALSCREEN
:
2733 RECT rect
= get_virtual_screen_rect();
2736 case SM_CXVIRTUALSCREEN
:
2738 RECT rect
= get_virtual_screen_rect();
2739 return rect
.right
- rect
.left
;
2741 case SM_CYVIRTUALSCREEN
:
2743 RECT rect
= get_virtual_screen_rect();
2744 return rect
.bottom
- rect
.top
;
2748 struct monitor_info info
;
2749 get_monitors_info( &info
);
2752 case SM_SAMEDISPLAYFORMAT
:
2755 return 0; /* FIXME */
2756 case SM_CXFOCUSBORDER
:
2757 case SM_CYFOCUSBORDER
:
2760 case SM_MEDIACENTER
:
2770 /***********************************************************************
2771 * GetSystemMetricsForDpi (USER32.@)
2773 INT WINAPI
GetSystemMetricsForDpi( INT index
, UINT dpi
)
2775 NONCLIENTMETRICSW ncm
;
2780 /* some metrics are dynamic */
2785 ncm
.cbSize
= sizeof(ncm
);
2786 SystemParametersInfoForDpi( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0, dpi
);
2787 return ncm
.iScrollWidth
;
2789 ncm
.cbSize
= sizeof(ncm
);
2790 SystemParametersInfoForDpi( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0, dpi
);
2791 return ncm
.iCaptionHeight
+ 1;
2796 ncm
.cbSize
= sizeof(ncm
);
2797 SystemParametersInfoForDpi( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0, dpi
);
2798 return ncm
.iScrollHeight
;
2801 return map_to_dpi( 32, dpi
);
2804 ret
= map_to_dpi( 32, dpi
);
2805 if (ret
>= 64) return 64;
2806 if (ret
>= 48) return 48;
2809 ncm
.cbSize
= sizeof(ncm
);
2810 SystemParametersInfoForDpi( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0, dpi
);
2811 return ncm
.iMenuHeight
+ 1;
2813 ncm
.cbSize
= sizeof(ncm
);
2814 SystemParametersInfoForDpi( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0, dpi
);
2815 return ncm
.iCaptionWidth
;
2817 ncm
.cbSize
= sizeof(ncm
);
2818 SystemParametersInfoForDpi( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0, dpi
);
2819 return ncm
.iCaptionHeight
;
2821 ncm
.cbSize
= sizeof(ncm
);
2822 SystemParametersInfoForDpi( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0, dpi
);
2823 return GetSystemMetricsForDpi( SM_CXDLGFRAME
, dpi
) + ncm
.iBorderWidth
;
2825 ncm
.cbSize
= sizeof(ncm
);
2826 SystemParametersInfoForDpi( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0, dpi
);
2827 return GetSystemMetricsForDpi( SM_CYDLGFRAME
, dpi
) + ncm
.iBorderWidth
;
2828 case SM_CXICONSPACING
:
2829 im
.cbSize
= sizeof(im
);
2830 SystemParametersInfoForDpi( SPI_GETICONMETRICS
, sizeof(im
), &im
, 0, dpi
);
2831 return im
.iHorzSpacing
;
2832 case SM_CYICONSPACING
:
2833 im
.cbSize
= sizeof(im
);
2834 SystemParametersInfoForDpi( SPI_GETICONMETRICS
, sizeof(im
), &im
, 0, dpi
);
2835 return im
.iVertSpacing
;
2838 return map_to_dpi( 16, dpi
) & ~1;
2839 case SM_CYSMCAPTION
:
2840 ncm
.cbSize
= sizeof(ncm
);
2841 SystemParametersInfoForDpi( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0, dpi
);
2842 return ncm
.iSmCaptionHeight
+ 1;
2844 ncm
.cbSize
= sizeof(ncm
);
2845 SystemParametersInfoForDpi( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0, dpi
);
2846 return ncm
.iSmCaptionWidth
;
2848 ncm
.cbSize
= sizeof(ncm
);
2849 SystemParametersInfoForDpi( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0, dpi
);
2850 return ncm
.iSmCaptionHeight
;
2852 ncm
.cbSize
= sizeof(ncm
);
2853 SystemParametersInfoForDpi( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0, dpi
);
2854 return ncm
.iMenuWidth
;
2856 ncm
.cbSize
= sizeof(ncm
);
2857 SystemParametersInfoForDpi( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0, dpi
);
2858 return ncm
.iMenuHeight
;
2859 case SM_CXMENUCHECK
:
2860 case SM_CYMENUCHECK
:
2863 ncm
.cbSize
= sizeof(ncm
);
2864 SystemParametersInfoForDpi( SPI_GETNONCLIENTMETRICS
, 0, &ncm
, 0, dpi
);
2865 hdc
= get_display_dc();
2866 get_text_metr_size( hdc
, &ncm
.lfMenuFont
, &tm
, NULL
);
2867 release_display_dc( hdc
);
2868 return tm
.tmHeight
<= 0 ? 13 : ((tm
.tmHeight
+ tm
.tmExternalLeading
- 1) | 1);
2871 return GetSystemMetrics( index
);
2876 /***********************************************************************
2877 * SwapMouseButton (USER32.@)
2878 * Reverse or restore the meaning of the left and right mouse buttons
2879 * fSwap [I ] TRUE - reverse, FALSE - original
2883 BOOL WINAPI
SwapMouseButton( BOOL fSwap
)
2885 BOOL prev
= GetSystemMetrics(SM_SWAPBUTTON
);
2886 SystemParametersInfoW(SPI_SETMOUSEBUTTONSWAP
, fSwap
, 0, 0);
2891 /**********************************************************************
2892 * SetDoubleClickTime (USER32.@)
2894 BOOL WINAPI
SetDoubleClickTime( UINT interval
)
2896 return SystemParametersInfoW(SPI_SETDOUBLECLICKTIME
, interval
, 0, 0);
2900 /**********************************************************************
2901 * GetDoubleClickTime (USER32.@)
2903 UINT WINAPI
GetDoubleClickTime(void)
2907 get_entry( &entry_DOUBLECLICKTIME
, 0, &time
);
2908 if (!time
) time
= 500;
2913 /*************************************************************************
2914 * GetSysColor (USER32.@)
2916 COLORREF WINAPI DECLSPEC_HOTPATCH
GetSysColor( INT nIndex
)
2920 if (nIndex
>= 0 && nIndex
< ARRAY_SIZE( system_colors
))
2921 get_entry( &system_colors
[nIndex
], 0, &ret
);
2926 /*************************************************************************
2927 * SetSysColors (USER32.@)
2929 BOOL WINAPI
SetSysColors( INT count
, const INT
*colors
, const COLORREF
*values
)
2933 if (IS_INTRESOURCE(colors
)) return FALSE
; /* stupid app passes a color instead of an array */
2935 for (i
= 0; i
< count
; i
++)
2936 if (colors
[i
] >= 0 && colors
[i
] <= ARRAY_SIZE( system_colors
))
2937 set_entry( &system_colors
[colors
[i
]], values
[i
], 0, 0 );
2939 /* Send WM_SYSCOLORCHANGE message to all windows */
2941 SendMessageTimeoutW( HWND_BROADCAST
, WM_SYSCOLORCHANGE
, 0, 0, SMTO_ABORTIFHUNG
, 2000, NULL
);
2943 /* Repaint affected portions of all visible windows */
2945 RedrawWindow( GetDesktopWindow(), NULL
, 0,
2946 RDW_INVALIDATE
| RDW_ERASE
| RDW_UPDATENOW
| RDW_ALLCHILDREN
);
2951 /*************************************************************************
2952 * SetSysColorsTemp (USER32.@)
2954 DWORD_PTR WINAPI
SetSysColorsTemp( const COLORREF
*pPens
, const HBRUSH
*pBrushes
, DWORD_PTR n
)
2956 FIXME( "no longer supported\n" );
2961 /***********************************************************************
2962 * GetSysColorBrush (USER32.@)
2964 HBRUSH WINAPI DECLSPEC_HOTPATCH
GetSysColorBrush( INT index
)
2966 if (index
< 0 || index
>= ARRAY_SIZE( system_colors
)) return 0;
2968 if (!system_colors
[index
].brush
)
2970 HBRUSH brush
= CreateSolidBrush( GetSysColor( index
));
2971 __wine_make_gdi_object_system( brush
, TRUE
);
2972 if (InterlockedCompareExchangePointer( (void **)&system_colors
[index
].brush
, brush
, 0 ))
2974 __wine_make_gdi_object_system( brush
, FALSE
);
2975 DeleteObject( brush
);
2978 return system_colors
[index
].brush
;
2982 /***********************************************************************
2985 HPEN
SYSCOLOR_GetPen( INT index
)
2987 /* We can assert here, because this function is internal to Wine */
2988 assert (0 <= index
&& index
< ARRAY_SIZE( system_colors
));
2990 if (!system_colors
[index
].pen
)
2992 HPEN pen
= CreatePen( PS_SOLID
, 1, GetSysColor( index
));
2993 __wine_make_gdi_object_system( pen
, TRUE
);
2994 if (InterlockedCompareExchangePointer( (void **)&system_colors
[index
].pen
, pen
, 0 ))
2996 __wine_make_gdi_object_system( pen
, FALSE
);
2997 DeleteObject( pen
);
3000 return system_colors
[index
].pen
;
3004 /***********************************************************************
3005 * SYSCOLOR_Get55AABrush
3007 HBRUSH
SYSCOLOR_Get55AABrush(void)
3009 static const WORD pattern
[] = { 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xaaaa };
3010 static HBRUSH brush_55aa
;
3014 HBITMAP bitmap
= CreateBitmap( 8, 8, 1, 1, pattern
);
3015 HBRUSH brush
= CreatePatternBrush( bitmap
);
3016 DeleteObject( bitmap
);
3017 __wine_make_gdi_object_system( brush
, TRUE
);
3018 if (InterlockedCompareExchangePointer( (void **)&brush_55aa
, brush
, 0 ))
3020 __wine_make_gdi_object_system( brush
, FALSE
);
3021 DeleteObject( brush
);
3027 /***********************************************************************
3028 * ChangeDisplaySettingsA (USER32.@)
3030 LONG WINAPI
ChangeDisplaySettingsA( LPDEVMODEA devmode
, DWORD flags
)
3032 if (devmode
) devmode
->dmDriverExtra
= 0;
3034 return ChangeDisplaySettingsExA(NULL
,devmode
,NULL
,flags
,NULL
);
3038 /***********************************************************************
3039 * ChangeDisplaySettingsW (USER32.@)
3041 LONG WINAPI
ChangeDisplaySettingsW( LPDEVMODEW devmode
, DWORD flags
)
3043 if (devmode
) devmode
->dmDriverExtra
= 0;
3045 return ChangeDisplaySettingsExW(NULL
,devmode
,NULL
,flags
,NULL
);
3049 /***********************************************************************
3050 * ChangeDisplaySettingsExA (USER32.@)
3052 LONG WINAPI
ChangeDisplaySettingsExA( LPCSTR devname
, LPDEVMODEA devmode
, HWND hwnd
,
3053 DWORD flags
, LPVOID lparam
)
3056 UNICODE_STRING nameW
;
3058 if (devname
) RtlCreateUnicodeStringFromAsciiz(&nameW
, devname
);
3059 else nameW
.Buffer
= NULL
;
3065 devmodeW
= GdiConvertToDevmodeW(devmode
);
3068 ret
= ChangeDisplaySettingsExW(nameW
.Buffer
, devmodeW
, hwnd
, flags
, lparam
);
3069 HeapFree(GetProcessHeap(), 0, devmodeW
);
3072 ret
= DISP_CHANGE_SUCCESSFUL
;
3076 ret
= ChangeDisplaySettingsExW(nameW
.Buffer
, NULL
, hwnd
, flags
, lparam
);
3079 if (devname
) RtlFreeUnicodeString(&nameW
);
3084 /***********************************************************************
3085 * ChangeDisplaySettingsExW (USER32.@)
3087 LONG WINAPI
ChangeDisplaySettingsExW( LPCWSTR devname
, LPDEVMODEW devmode
, HWND hwnd
,
3088 DWORD flags
, LPVOID lparam
)
3090 return USER_Driver
->pChangeDisplaySettingsEx( devname
, devmode
, hwnd
, flags
, lparam
);
3094 /***********************************************************************
3095 * DisplayConfigGetDeviceInfo (USER32.@)
3097 LONG WINAPI
DisplayConfigGetDeviceInfo(DISPLAYCONFIG_DEVICE_INFO_HEADER
*packet
)
3099 FIXME("stub: %p\n", packet
);
3100 return ERROR_NOT_SUPPORTED
;
3103 /***********************************************************************
3104 * EnumDisplaySettingsW (USER32.@)
3107 * TRUE if nth setting exists found (described in the LPDEVMODEW struct)
3108 * FALSE if we do not have the nth setting
3110 BOOL WINAPI
EnumDisplaySettingsW( LPCWSTR name
, DWORD n
, LPDEVMODEW devmode
)
3112 return EnumDisplaySettingsExW(name
, n
, devmode
, 0);
3116 /***********************************************************************
3117 * EnumDisplaySettingsA (USER32.@)
3119 BOOL WINAPI
EnumDisplaySettingsA(LPCSTR name
,DWORD n
,LPDEVMODEA devmode
)
3121 return EnumDisplaySettingsExA(name
, n
, devmode
, 0);
3125 /***********************************************************************
3126 * EnumDisplaySettingsExA (USER32.@)
3128 BOOL WINAPI
EnumDisplaySettingsExA(LPCSTR lpszDeviceName
, DWORD iModeNum
,
3129 LPDEVMODEA lpDevMode
, DWORD dwFlags
)
3133 UNICODE_STRING nameW
;
3135 if (lpszDeviceName
) RtlCreateUnicodeStringFromAsciiz(&nameW
, lpszDeviceName
);
3136 else nameW
.Buffer
= NULL
;
3138 ret
= EnumDisplaySettingsExW(nameW
.Buffer
,iModeNum
,&devmodeW
,dwFlags
);
3141 lpDevMode
->dmSize
= FIELD_OFFSET(DEVMODEA
, dmICMMethod
);
3142 lpDevMode
->dmSpecVersion
= devmodeW
.dmSpecVersion
;
3143 lpDevMode
->dmDriverVersion
= devmodeW
.dmDriverVersion
;
3144 WideCharToMultiByte(CP_ACP
, 0, devmodeW
.dmDeviceName
, -1,
3145 (LPSTR
)lpDevMode
->dmDeviceName
, CCHDEVICENAME
, NULL
, NULL
);
3146 lpDevMode
->dmDriverExtra
= 0; /* FIXME */
3147 lpDevMode
->dmBitsPerPel
= devmodeW
.dmBitsPerPel
;
3148 lpDevMode
->dmPelsHeight
= devmodeW
.dmPelsHeight
;
3149 lpDevMode
->dmPelsWidth
= devmodeW
.dmPelsWidth
;
3150 lpDevMode
->u2
.dmDisplayFlags
= devmodeW
.u2
.dmDisplayFlags
;
3151 lpDevMode
->dmDisplayFrequency
= devmodeW
.dmDisplayFrequency
;
3152 lpDevMode
->dmFields
= devmodeW
.dmFields
;
3154 lpDevMode
->u1
.s2
.dmPosition
.x
= devmodeW
.u1
.s2
.dmPosition
.x
;
3155 lpDevMode
->u1
.s2
.dmPosition
.y
= devmodeW
.u1
.s2
.dmPosition
.y
;
3156 lpDevMode
->u1
.s2
.dmDisplayOrientation
= devmodeW
.u1
.s2
.dmDisplayOrientation
;
3157 lpDevMode
->u1
.s2
.dmDisplayFixedOutput
= devmodeW
.u1
.s2
.dmDisplayFixedOutput
;
3159 if (lpszDeviceName
) RtlFreeUnicodeString(&nameW
);
3164 /***********************************************************************
3165 * EnumDisplaySettingsExW (USER32.@)
3167 BOOL WINAPI
EnumDisplaySettingsExW(LPCWSTR lpszDeviceName
, DWORD iModeNum
,
3168 LPDEVMODEW lpDevMode
, DWORD dwFlags
)
3170 return USER_Driver
->pEnumDisplaySettingsEx(lpszDeviceName
, iModeNum
, lpDevMode
, dwFlags
);
3174 static DPI_AWARENESS dpi_awareness
;
3176 /**********************************************************************
3177 * SetProcessDpiAwarenessContext (USER32.@)
3179 BOOL WINAPI
SetProcessDpiAwarenessContext( DPI_AWARENESS_CONTEXT context
)
3181 DPI_AWARENESS val
= GetAwarenessFromDpiAwarenessContext( context
);
3183 if (val
== DPI_AWARENESS_INVALID
)
3185 SetLastError( ERROR_INVALID_PARAMETER
);
3188 val
|= 0x10; /* avoid 0 value */
3189 if (InterlockedCompareExchange( &dpi_awareness
, val
, 0 ))
3191 SetLastError( ERROR_ACCESS_DENIED
);
3194 TRACE( "set to %p\n", context
);
3198 /**********************************************************************
3199 * GetProcessDpiAwarenessInternal (USER32.@)
3201 BOOL WINAPI
GetProcessDpiAwarenessInternal( HANDLE process
, DPI_AWARENESS
*awareness
)
3203 if (process
&& process
!= GetCurrentProcess())
3205 WARN( "not supported on other process %p\n", process
);
3206 *awareness
= DPI_AWARENESS_UNAWARE
;
3208 else *awareness
= dpi_awareness
& 3;
3212 /**********************************************************************
3213 * SetProcessDpiAwarenessInternal (USER32.@)
3215 BOOL WINAPI
SetProcessDpiAwarenessInternal( DPI_AWARENESS awareness
)
3217 static const DPI_AWARENESS_CONTEXT contexts
[3] = { DPI_AWARENESS_CONTEXT_UNAWARE
,
3218 DPI_AWARENESS_CONTEXT_SYSTEM_AWARE
,
3219 DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE
};
3221 if (awareness
< DPI_AWARENESS_UNAWARE
|| awareness
> DPI_AWARENESS_PER_MONITOR_AWARE
)
3223 SetLastError( ERROR_INVALID_PARAMETER
);
3226 return SetProcessDpiAwarenessContext( contexts
[awareness
] );
3229 /***********************************************************************
3230 * AreDpiAwarenessContextsEqual (USER32.@)
3232 BOOL WINAPI
AreDpiAwarenessContextsEqual( DPI_AWARENESS_CONTEXT ctx1
, DPI_AWARENESS_CONTEXT ctx2
)
3234 DPI_AWARENESS aware1
= GetAwarenessFromDpiAwarenessContext( ctx1
);
3235 DPI_AWARENESS aware2
= GetAwarenessFromDpiAwarenessContext( ctx2
);
3236 return aware1
!= DPI_AWARENESS_INVALID
&& aware1
== aware2
;
3239 /***********************************************************************
3240 * GetAwarenessFromDpiAwarenessContext (USER32.@)
3242 DPI_AWARENESS WINAPI
GetAwarenessFromDpiAwarenessContext( DPI_AWARENESS_CONTEXT context
)
3244 switch ((ULONG_PTR
)context
)
3252 return (ULONG_PTR
)context
& 3;
3253 case (ULONG_PTR
)DPI_AWARENESS_CONTEXT_UNAWARE
:
3254 case (ULONG_PTR
)DPI_AWARENESS_CONTEXT_SYSTEM_AWARE
:
3255 case (ULONG_PTR
)DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE
:
3256 return ~(ULONG_PTR
)context
;
3258 return DPI_AWARENESS_INVALID
;
3262 /***********************************************************************
3263 * IsValidDpiAwarenessContext (USER32.@)
3265 BOOL WINAPI
IsValidDpiAwarenessContext( DPI_AWARENESS_CONTEXT context
)
3267 return GetAwarenessFromDpiAwarenessContext( context
) != DPI_AWARENESS_INVALID
;
3270 /***********************************************************************
3271 * SetProcessDPIAware (USER32.@)
3273 BOOL WINAPI
SetProcessDPIAware(void)
3276 InterlockedCompareExchange( &dpi_awareness
, 0x11, 0 );
3280 /***********************************************************************
3281 * IsProcessDPIAware (USER32.@)
3283 BOOL WINAPI
IsProcessDPIAware(void)
3285 return GetAwarenessFromDpiAwarenessContext( GetThreadDpiAwarenessContext() ) != DPI_AWARENESS_UNAWARE
;
3288 /***********************************************************************
3289 * GetDpiForSystem (USER32.@)
3291 UINT WINAPI
GetDpiForSystem(void)
3293 if (!IsProcessDPIAware()) return USER_DEFAULT_SCREEN_DPI
;
3294 return get_system_dpi();
3297 /***********************************************************************
3298 * GetDpiForMonitorInternal (USER32.@)
3300 BOOL WINAPI
GetDpiForMonitorInternal( HMONITOR monitor
, UINT type
, UINT
*x
, UINT
*y
)
3302 UINT dpi
= get_system_dpi();
3304 WARN( "(%p, %u, %p, %p): semi-stub\n", monitor
, type
, x
, y
);
3311 /***********************************************************************
3312 * GetDpiForWindow (USER32.@)
3314 UINT WINAPI
GetDpiForWindow( HWND hwnd
)
3318 switch (GetAwarenessFromDpiAwarenessContext( GetWindowDpiAwarenessContext( hwnd
)))
3320 case DPI_AWARENESS_UNAWARE
:
3321 return USER_DEFAULT_SCREEN_DPI
;
3322 case DPI_AWARENESS_SYSTEM_AWARE
:
3323 return get_system_dpi();
3324 case DPI_AWARENESS_PER_MONITOR_AWARE
:
3325 GetDpiForMonitorInternal( MonitorFromWindow( hwnd
, MONITOR_DEFAULTTOPRIMARY
),
3326 0 /* MDT_EFFECTIVE_DPI */, &dpi
, NULL
);
3333 /**********************************************************************
3334 * GetThreadDpiAwarenessContext (USER32.@)
3336 DPI_AWARENESS_CONTEXT WINAPI
GetThreadDpiAwarenessContext(void)
3338 struct user_thread_info
*info
= get_user_thread_info();
3340 if (info
->dpi_awareness
) return ULongToHandle( info
->dpi_awareness
);
3341 if (dpi_awareness
) return ULongToHandle( dpi_awareness
);
3342 return (DPI_AWARENESS_CONTEXT
)(0x10 | DPI_AWARENESS_SYSTEM_AWARE
); /* FIXME: should default to unaware */
3345 /**********************************************************************
3346 * SetThreadDpiAwarenessContext (USER32.@)
3348 DPI_AWARENESS_CONTEXT WINAPI
SetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT context
)
3350 struct user_thread_info
*info
= get_user_thread_info();
3351 DPI_AWARENESS prev
, val
= GetAwarenessFromDpiAwarenessContext( context
);
3353 if (val
== DPI_AWARENESS_INVALID
)
3355 SetLastError( ERROR_INVALID_PARAMETER
);
3358 if (!(prev
= info
->dpi_awareness
))
3360 prev
= dpi_awareness
;
3361 if (!prev
) prev
= 0x10 | DPI_AWARENESS_UNAWARE
;
3362 prev
|= 0x80000000; /* restore to process default */
3364 if (((ULONG_PTR
)context
& ~(ULONG_PTR
)0x13) == 0x80000000) info
->dpi_awareness
= 0;
3365 else info
->dpi_awareness
= val
| 0x10;
3366 return ULongToHandle( prev
);
3369 /**********************************************************************
3370 * GetAutoRotationState [USER32.@]
3372 BOOL WINAPI
GetAutoRotationState( AR_STATE
*state
)
3374 FIXME("(%p): stub\n", state
);
3375 *state
= AR_NOT_SUPPORTED
;
3379 /**********************************************************************
3380 * GetDisplayAutoRotationPreferences [USER32.@]
3382 BOOL WINAPI
GetDisplayAutoRotationPreferences( ORIENTATION_PREFERENCE
*orientation
)
3384 FIXME("(%p): stub\n", orientation
);
3385 *orientation
= ORIENTATION_PREFERENCE_NONE
;