33#ifndef SPI_GETDESKWALLPAPER
34# define SPI_GETDESKWALLPAPER 0x0073
61#define eq(received, expected, label, type) \
62 ok((received) == (expected), "%s: got " type " instead of " type "\n", (label),(received),(expected))
65#define SPI_SETBEEP_REGKEY "Control Panel\\Sound"
66#define SPI_SETBEEP_VALNAME "Beep"
67#define SPI_SETMOUSE_REGKEY "Control Panel\\Mouse"
68#define SPI_SETMOUSE_VALNAME1 "MouseThreshold1"
69#define SPI_SETMOUSE_VALNAME2 "MouseThreshold2"
70#define SPI_SETMOUSE_VALNAME3 "MouseSpeed"
71#define SPI_SETBORDER_REGKEY "Control Panel\\Desktop\\WindowMetrics"
72#define SPI_SETBORDER_REGKEY2 "Control Panel\\Desktop"
73#define SPI_SETBORDER_VALNAME "BorderWidth"
74#define SPI_METRIC_REGKEY "Control Panel\\Desktop\\WindowMetrics"
75#define SPI_SCROLLWIDTH_VALNAME "ScrollWidth"
76#define SPI_SCROLLHEIGHT_VALNAME "ScrollHeight"
77#define SPI_CAPTIONWIDTH_VALNAME "CaptionWidth"
78#define SPI_CAPTIONHEIGHT_VALNAME "CaptionHeight"
79#define SPI_CAPTIONFONT_VALNAME "CaptionFont"
80#define SPI_SMCAPTIONWIDTH_VALNAME "SmCaptionWidth"
81#define SPI_SMCAPTIONHEIGHT_VALNAME "SmCaptionHeight"
82#define SPI_SMCAPTIONFONT_VALNAME "SmCaptionFont"
83#define SPI_MENUWIDTH_VALNAME "MenuWidth"
84#define SPI_MENUHEIGHT_VALNAME "MenuHeight"
85#define SPI_MENUFONT_VALNAME "MenuFont"
86#define SPI_STATUSFONT_VALNAME "StatusFont"
87#define SPI_MESSAGEFONT_VALNAME "MessageFont"
89#define SPI_SETKEYBOARDSPEED_REGKEY "Control Panel\\Keyboard"
90#define SPI_SETKEYBOARDSPEED_VALNAME "KeyboardSpeed"
91#define SPI_ICONHORIZONTALSPACING_REGKEY "Control Panel\\Desktop\\WindowMetrics"
92#define SPI_ICONHORIZONTALSPACING_REGKEY2 "Control Panel\\Desktop"
93#define SPI_ICONHORIZONTALSPACING_VALNAME "IconSpacing"
94#define SPI_ICONVERTICALSPACING_REGKEY "Control Panel\\Desktop\\WindowMetrics"
95#define SPI_ICONVERTICALSPACING_REGKEY2 "Control Panel\\Desktop"
96#define SPI_ICONVERTICALSPACING_VALNAME "IconVerticalSpacing"
97#define SPI_MINIMIZEDMETRICS_REGKEY "Control Panel\\Desktop\\WindowMetrics"
98#define SPI_MINWIDTH_VALNAME "MinWidth"
99#define SPI_MINHORZGAP_VALNAME "MinHorzGap"
100#define SPI_MINVERTGAP_VALNAME "MinVertGap"
101#define SPI_MINARRANGE_VALNAME "MinArrange"
102#define SPI_SETSCREENSAVETIMEOUT_REGKEY "Control Panel\\Desktop"
103#define SPI_SETSCREENSAVETIMEOUT_VALNAME "ScreenSaveTimeOut"
104#define SPI_SETSCREENSAVEACTIVE_REGKEY "Control Panel\\Desktop"
105#define SPI_SETSCREENSAVEACTIVE_VALNAME "ScreenSaveActive"
106#define SPI_SETGRIDGRANULARITY_REGKEY "Control Panel\\Desktop"
107#define SPI_SETGRIDGRANULARITY_VALNAME "GridGranularity"
108#define SPI_SETKEYBOARDDELAY_REGKEY "Control Panel\\Keyboard"
109#define SPI_SETKEYBOARDDELAY_VALNAME "KeyboardDelay"
110#define SPI_SETICONTITLEWRAP_REGKEY1 "Control Panel\\Desktop\\WindowMetrics"
111#define SPI_SETICONTITLEWRAP_REGKEY2 "Control Panel\\Desktop"
112#define SPI_SETICONTITLEWRAP_VALNAME "IconTitleWrap"
113#define SPI_SETMENUDROPALIGNMENT_REGKEY1 "Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows"
114#define SPI_SETMENUDROPALIGNMENT_REGKEY2 "Control Panel\\Desktop"
115#define SPI_SETMENUDROPALIGNMENT_VALNAME "MenuDropAlignment"
116#define SPI_SETDOUBLECLKWIDTH_REGKEY1 "Control Panel\\Mouse"
117#define SPI_SETDOUBLECLKWIDTH_REGKEY2 "Control Panel\\Desktop"
118#define SPI_SETDOUBLECLKWIDTH_VALNAME "DoubleClickWidth"
119#define SPI_SETDOUBLECLKHEIGHT_REGKEY1 "Control Panel\\Mouse"
120#define SPI_SETDOUBLECLKHEIGHT_REGKEY2 "Control Panel\\Desktop"
121#define SPI_SETDOUBLECLKHEIGHT_VALNAME "DoubleClickHeight"
122#define SPI_SETDOUBLECLICKTIME_REGKEY "Control Panel\\Mouse"
123#define SPI_SETDOUBLECLICKTIME_VALNAME "DoubleClickSpeed"
124#define SPI_SETMOUSEBUTTONSWAP_REGKEY "Control Panel\\Mouse"
125#define SPI_SETMOUSEBUTTONSWAP_VALNAME "SwapMouseButtons"
126#define SPI_SETWORKAREA_REGKEY "Control Panel\\Desktop"
127#define SPI_SETWORKAREA_VALNAME "WINE_WorkArea"
128#define SPI_SETSHOWSOUNDS_REGKEY "Control Panel\\Accessibility\\ShowSounds"
129#define SPI_SETSHOWSOUNDS_VALNAME "On"
130#define SPI_SETKEYBOARDPREF_REGKEY "Control Panel\\Accessibility\\Keyboard Preference"
131#define SPI_SETKEYBOARDPREF_VALNAME "On"
132#define SPI_SETKEYBOARDPREF_REGKEY_LEGACY "Control Panel\\Accessibility"
133#define SPI_SETKEYBOARDPREF_VALNAME_LEGACY "Keyboard Preference"
134#define SPI_SETSCREENREADER_REGKEY "Control Panel\\Accessibility\\Blind Access"
135#define SPI_SETSCREENREADER_VALNAME "On"
136#define SPI_SETSCREENREADER_REGKEY_LEGACY "Control Panel\\Accessibility"
137#define SPI_SETSCREENREADER_VALNAME_LEGACY "Blind Access"
138#define SPI_SETFONTSMOOTHING_REGKEY "Control Panel\\Desktop"
139#define SPI_SETFONTSMOOTHING_VALNAME "FontSmoothing"
140#define SPI_SETFONTSMOOTHINGTYPE_VALNAME "FontSmoothingType"
141#define SPI_SETFONTSMOOTHINGCONTRAST_VALNAME "FontSmoothingGamma"
142#define SPI_SETFONTSMOOTHINGORIENTATION_VALNAME "FontSmoothingOrientation"
143#define SPI_SETLOWPOWERACTIVE_REGKEY "Control Panel\\Desktop"
144#define SPI_SETLOWPOWERACTIVE_VALNAME "LowPowerActive"
145#define SPI_SETPOWEROFFACTIVE_REGKEY "Control Panel\\Desktop"
146#define SPI_SETPOWEROFFACTIVE_VALNAME "PowerOffActive"
147#define SPI_SETDRAGFULLWINDOWS_REGKEY "Control Panel\\Desktop"
148#define SPI_SETDRAGFULLWINDOWS_VALNAME "DragFullWindows"
149#define SPI_SETSNAPTODEFBUTTON_REGKEY "Control Panel\\Mouse"
150#define SPI_SETSNAPTODEFBUTTON_VALNAME "SnapToDefaultButton"
151#define SPI_SETMOUSEHOVERWIDTH_REGKEY "Control Panel\\Mouse"
152#define SPI_SETMOUSEHOVERWIDTH_VALNAME "MouseHoverWidth"
153#define SPI_SETMOUSEHOVERHEIGHT_REGKEY "Control Panel\\Mouse"
154#define SPI_SETMOUSEHOVERHEIGHT_VALNAME "MouseHoverHeight"
155#define SPI_SETMOUSEHOVERTIME_REGKEY "Control Panel\\Mouse"
156#define SPI_SETMOUSEHOVERTIME_VALNAME "MouseHoverTime"
157#define SPI_SETMOUSESCROLLCHARS_REGKEY "Control Panel\\Desktop"
158#define SPI_SETMOUSESCROLLCHARS_VALNAME "WheelScrollChars"
159#define SPI_SETMOUSESCROLLLINES_REGKEY "Control Panel\\Desktop"
160#define SPI_SETMOUSESCROLLLINES_VALNAME "WheelScrollLines"
161#define SPI_SETMENUSHOWDELAY_REGKEY "Control Panel\\Desktop"
162#define SPI_SETMENUSHOWDELAY_VALNAME "MenuShowDelay"
163#define SPI_SETDESKWALLPAPER_REGKEY "Control Panel\\Desktop"
164#define SPI_SETDESKWALLPAPER_VALNAME "Wallpaper"
167#define WINE_CURRENT_USER_REGKEY "Wine"
204 if (pSetThreadDpiAwarenessContext)
207 dpi = pGetDpiForSystem();
208 pSetThreadDpiAwarenessContext(
context );
223 case WM_DISPLAYCHANGE:
233 if(
wParam == SPI_SETWORKAREA){
245 ok(0,
"too many changes counter=%d last change=%d\n",
253 if(
wParam == SPI_SETWORKAREA)
301 skip(
"%s not supported on this platform\n",
name);
305 skip(
"%s does not have privileges to run\n",
name);
309 trace(
"%s failed for reason: %d. Indicating test failure and skipping remainder of test\n",
name,
last_error);
310 ok(rc!=0,
"SystemParametersInfoA: rc=%d err=%d\n",rc,
last_error);
316 ok(rc!=0,
"SystemParametersInfoA: rc=%d err=%d\n",rc,
last_error);
336 valueLen=
sizeof(
value);
342 ok(
type == exp_type,
"wrong type %u/%u\n",
type, exp_type );
347 "Wrong value in registry: %s %s %08x/%08x\n",
352 "Wrong value in registry: %s %s '%s' instead of '%s'\n",
353 subKey1, valName1,
value, (
const char *)exp_value );
360 ok(0,
"Missing registry entry: subKey=%s, valName=%s\n",
366 valueLen=
sizeof(
value);
372 ok(
type == exp_type,
"wrong type %u/%u\n",
type, exp_type );
377 "Wrong value in registry: %s %s %08x/%08x\n",
382 "Wrong value in registry: %s %s '%s' instead of '%s'\n",
383 subKey1, valName1,
value, (
const char *)exp_value );
390 ok( 0,
"Missing registry entry: subKey=%s, valName=%s\n",
397 valueLen=
sizeof(
value);
403 ok(
type == exp_type,
"wrong type %u/%u\n",
type, exp_type );
408 "Wrong value in registry: %s %s %08x/%08x\n",
413 "Wrong value in registry: %s %s '%s' instead of '%s'\n",
414 subKey1, valName1,
value, (
const char *)exp_value );
421 ok( 0,
"Missing registry entry: subKey=%s, valName=%s\n",
427 valueLen=
sizeof(
value);
433 ok(
type == exp_type,
"wrong type %u/%u\n",
type, exp_type );
438 "Wrong value in registry: %s %s %08x/%08x\n",
443 "Wrong value in registry: %s %s '%s' instead of '%s'\n",
444 subKey1, valName1,
value, (
const char *)exp_value );
451 ok( 0,
"Missing registry entry: subKey=%s, valName=%s\n",
457 "Missing registry values: %s or %s in keys: %s or %s\n",
458 valName1, (valName2?valName2:
"<n/a>"), subKey1, (subKey2?subKey2:
"<n/a>") );
461#define test_reg_key( subKey, valName, testValue ) \
462 _test_reg_key( subKey, NULL, valName, NULL, testValue, REG_SZ, FALSE )
463#define test_reg_key_optional( subKey, valName, testValue ) \
464 _test_reg_key( subKey, NULL, valName, NULL, testValue, REG_SZ, TRUE )
465#define test_reg_key_ex( subKey1, subKey2, valName, testValue ) \
466 _test_reg_key( subKey1, subKey2, valName, NULL, testValue, REG_SZ, FALSE )
467#define test_reg_key_ex2( subKey1, subKey2, valName1, valName2, testValue ) \
468 _test_reg_key( subKey1, subKey2, valName1, valName2, testValue, REG_SZ, FALSE )
469#define test_reg_key_ex2_optional( subKey1, subKey2, valName1, valName2, testValue ) \
470 _test_reg_key( subKey1, subKey2, valName1, valName2, testValue, REG_SZ, TRUE )
471#define test_reg_key_dword( subKey, valName, testValue ) \
472 _test_reg_key( subKey, NULL, valName, NULL, testValue, REG_DWORD, FALSE )
573 trace(
"testing SPI_{GET,SET}BEEP\n");
582 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
586 curr_val ?
"Yes" :
"No" );
588 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
589 eq(
b, curr_val,
"SPI_{GET,SET}BEEP",
"%d" );
593 ok(rc,
"SystemParametersInfoW: rc=%d err=%d\n", rc,
GetLastError());
594 eq(
b, curr_val,
"SystemParametersInfoW",
"%d" );
599 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
606 ok(rc,
"SystemParametersInfo: rc=%d err=%d\n", rc,
GetLastError());
610 curr_val ?
"Yes" :
"No" );
612 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
613 eq(
b, curr_val,
"SPI_{GET,SET}BEEP",
"%d" );
617 ok(rc,
"SystemParametersInfoW: rc=%d err=%d\n", rc,
GetLastError());
618 eq(
b, curr_val,
"SystemParametersInfoW",
"%d" );
623 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
639 static int aw_turn = 0;
653 ok(rc,
"SystemParametersInfo: rc=%d err=%d\n", rc,
GetLastError());
655 for (
i = 0;
i < 3;
i++)
662 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
663 for (
i = 0;
i < 3;
i++)
666 "incorrect value for %d: %d != %d\n",
i,
mi[
i], curr_val[
i]);
670 ok(rc,
"SystemParametersInfoW: rc=%d err=%d\n", rc,
GetLastError());
671 for (
i = 0;
i < 3;
i++)
674 "incorrect value for %d: %d != %d\n",
i,
mi[
i], curr_val[
i]);
680 for (
i = 0;
i < nchange;
i++)
686 ok( proj_change[
i].
x == mv.
x,
"Projected dx and real dx comparison. May fail under high load.\n" );
687 ok( proj_change[
i].
y == mv.
y,
"Projected dy equals real dy. May fail under high load.\n" );
699 INT curr_val[3] = {6, 10, 1};
702 POINT req_change[] = { {6, 6}, { 7, 6}, { 8, 6}, {10, 10}, {11, 10}, {100, 100} };
703 POINT proj_change1[] = { {6, 6}, {14, 6}, {16, 6}, {20, 20}, {22, 20}, {200, 200} };
704 POINT proj_change2[] = { {6, 6}, {14, 6}, {16, 6}, {20, 20}, {44, 20}, {400, 400} };
705 POINT proj_change3[] = { {6, 6}, {14, 6}, {16, 6}, {20, 20}, {22, 20}, {200, 200} };
706 POINT proj_change4[] = { {6, 6}, { 7, 6}, { 8, 6}, {10, 10}, {11, 10}, {100, 100} };
707 POINT proj_change5[] = { {6, 6}, { 7, 6}, {16, 6}, {20, 20}, {22, 20}, {200, 200} };
708 POINT proj_change6[] = { {6, 6}, {28, 6}, {32, 6}, {40, 40}, {44, 40}, {400, 400} };
709 POINT proj_change7[] = { {6, 6}, {14, 6}, {32, 6}, {40, 40}, {44, 40}, {400, 400} };
710 POINT proj_change8[] = { {6, 6}, {28, 6}, {32, 6}, {40, 40}, {44, 40}, {400, 400} };
714 trace(
"testing SPI_{GET,SET}MOUSE\n");
754 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
762 NONCLIENTMETRICSA ncm;
764 ncm.cbSize =
FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth);
766 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
770 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
773 ncm.iBorderWidth = curr_val;
777 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
782 if( regval != curr_val)
784 ok( regval==curr_val,
"wrong value in registry %d, expected %d\n", regval, curr_val);
787 if (curr_val == 0) curr_val = 1;
790 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
791 eq( (
UINT)ncm.iBorderWidth, curr_val,
"NonClientMetric.iBorderWidth",
"%d");
794 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
795 eq(
border, curr_val,
"SPI_{GET,SET}BORDER",
"%d");
809 NONCLIENTMETRICSA ncmsave;
813 ncmsave.cbSize =
FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth);
816 win_skip(
"SPI_GETNONCLIENTMETRICS is not available\n");
823 "Control Panel\\Desktop\\WindowMetrics",
"CaptionWidth",
dpi);
824 ncmsave.iCaptionWidth = CaptionWidth;
833 trace(
"testing SPI_{GET,SET}BORDER\n");
840 PaddedBorderWidth = ncmsave.iBorderWidth - old_border;
841 if( PaddedBorderWidth){
842 win_skip(
"Cannot reliably restore border width yet (PaddedBorderWidth = %d)\n",
847 if ( old_border == 7 || old_border == 20 )
861 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
868 const UINT vals[]={0,20,31};
871 trace(
"testing SPI_{GET,SET}KEYBOARDSPEED\n");
892 eq(
v, vals[
i],
"SPI_{GET,SET}KEYBOARDSPEED",
"%d" );
896 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
909 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
911 curr_val =
max( curr_val, min_val );
916 if( regval != curr_val)
918 ok( curr_val == regval,
919 "wrong value in registry %d, expected %d\n", regval, curr_val);
922 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
923 eq( spacing, curr_val,
"ICONHORIZONTALSPACING",
"%d");
927 im.cbSize =
sizeof(ICONMETRICSA);
929 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
930 eq( im.iHorzSpacing, curr_val,
"SPI_GETICONMETRICS",
"%d" );
939 trace(
"testing SPI_ICONHORIZONTALSPACING\n");
950 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
957 const UINT vals[]={0,32767};
960 trace(
"testing SPI_{GET,SET}SCREENSAVETIMEOUT\n");
982 eq(
v, vals[
i],
"SPI_{GET,SET}SCREENSAVETIMEOUT",
"%d" );
987 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
997 trace(
"testing SPI_{GET,SET}SCREENSAVEACTIVE\n");
1014 vals[
i] ?
"1" :
"0" );
1019 "SPI_{GET,SET}SCREENSAVEACTIVE: got %d instead of %d\n",
v, vals[
i]);
1023 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
1035 const UINT vals[]={0,3};
1038 trace(
"testing SPI_{GET,SET}KEYBOARDDELAY\n");
1060 eq( delay, vals[
i],
"SPI_{GET,SET}KEYBOARDDELAY",
"%d" );
1064 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
1078 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
1080 curr_val =
max( curr_val, min_val );
1085 if( regval != curr_val)
1087 ok( curr_val == regval,
1088 "wrong value in registry %d, expected %d\n", regval, curr_val);
1091 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
1092 eq( spacing, curr_val,
"ICONVERTICALSPACING",
"%d" );
1096 im.cbSize =
sizeof(ICONMETRICSA);
1098 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
1099 eq( im.iVertSpacing, curr_val,
"SPI_GETICONMETRICS",
"%d" );
1108 trace(
"testing SPI_ICONVERTICALSPACING\n");
1121 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
1139 trace(
"testing SPI_{GET,SET}ICONTITLEWRAP\n");
1157 if( regval != vals[
i])
1160 ok( regval == vals[
i],
"wrong value in registry %d, expected %d\n", regval, vals[
i] );
1164 eq(
v, vals[
i],
"SPI_{GET,SET}ICONTITLEWRAP",
"%d" );
1166 im.cbSize =
sizeof(ICONMETRICSA);
1168 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
1169 eq( im.iTitleWrap, (
BOOL)vals[
i],
"SPI_GETICONMETRICS",
"%d" );
1173 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
1183 trace(
"testing SPI_{GET,SET}MENUDROPALIGNMENT\n");
1201 vals[
i] ?
"1" :
"0" );
1205 eq(
v, vals[
i],
"SPI_{GET,SET}MENUDROPALIGNMENT",
"%d" );
1207 "SM_MENUDROPALIGNMENT",
"%d" );
1212 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
1219 const UINT vals[]={0,10000};
1222 trace(
"testing SPI_{GET,SET}DOUBLECLKWIDTH\n");
1241 "SM_CXDOUBLECLK",
"%d" );
1246 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
1253 const UINT vals[]={0,10000};
1256 trace(
"testing SPI_{GET,SET}DOUBLECLKHEIGHT\n");
1275 "SM_CYDOUBLECLK",
"%d" );
1280 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
1291 trace(
"testing SPI_{GET,SET}DOUBLECLICKTIME\n");
1311 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
1318 saved_val = curr_val;
1336 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
1346 trace(
"testing SPI_{GET,SET}MOUSEBUTTONSWAP\n");
1359 vals[
i] ?
"1" :
"0" );
1361 "SM_SWAPBUTTON",
"%d" );
1364 "SwapMouseButton",
"%d" );
1365 ok( rc==(
BOOL)vals[
i],
"SwapMouseButton does not return previous state (really %d)\n", rc );
1370 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
1378 trace(
"testing SPI_GETFASTTASKSWITCH\n");
1396 trace(
"testing SPI_{GET,SET}DRAGFULLWINDOWS\n");
1415 vals[
i] ?
"1" :
"0" );
1419 eq(
v, vals[
i],
"SPI_{GET,SET}DRAGFULLWINDOWS",
"%d" );
1423 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
1426#define test_reg_metric( KEY, VAL, val) do { \
1428 regval = metricfromreg( KEY, VAL, dpi);\
1429 ok( regval==val, "wrong value \"%s\" in registry %d, expected %d\n", VAL, regval, val);\
1432#define test_reg_metric2( KEY1, KEY2, VAL, val) do { \
1434 regval = metricfromreg( KEY1, VAL, dpi);\
1435 if( regval != val) regval = metricfromreg( KEY2, VAL, dpi);\
1436 ok( regval==val, "wrong value \"%s\" in registry %d, expected %d\n", VAL, regval, val);\
1439#define test_reg_font( KEY, VAL, LF) do { \
1441 lffromreg( KEY, VAL, &lfreg);\
1442 ok( (lfreg.lfHeight < 0 ? (LF).lfHeight == MulDiv( lfreg.lfHeight, dpi, real_dpi ) : \
1443 MulDiv( -(LF).lfHeight , 72, dpi) == lfreg.lfHeight )&&\
1444 (LF).lfWidth == lfreg.lfWidth &&\
1445 (LF).lfWeight == lfreg.lfWeight &&\
1446 !strcmp( (LF).lfFaceName, lfreg.lfFaceName)\
1447 , "wrong value \"%s\" in registry %d, %d\n", VAL, (LF).lfHeight, lfreg.lfHeight);\
1450#define TEST_NONCLIENTMETRICS_REG( ncm) do { \
1452test_reg_metric( SPI_METRIC_REGKEY, SPI_SCROLLWIDTH_VALNAME, (ncm).iScrollWidth);\
1453test_reg_metric( SPI_METRIC_REGKEY, SPI_SCROLLHEIGHT_VALNAME, (ncm).iScrollHeight);\
1455test_reg_metric( SPI_METRIC_REGKEY, SPI_CAPTIONHEIGHT_VALNAME, (ncm).iCaptionHeight);\
1456test_reg_metric( SPI_METRIC_REGKEY, SPI_SMCAPTIONWIDTH_VALNAME, (ncm).iSmCaptionWidth);\
1457test_reg_metric( SPI_METRIC_REGKEY, SPI_SMCAPTIONHEIGHT_VALNAME, (ncm).iSmCaptionHeight);\
1458test_reg_metric( SPI_METRIC_REGKEY, SPI_MENUWIDTH_VALNAME, (ncm).iMenuWidth);\
1459test_reg_metric( SPI_METRIC_REGKEY, SPI_MENUHEIGHT_VALNAME, (ncm).iMenuHeight);\
1460test_reg_font( SPI_METRIC_REGKEY, SPI_MENUFONT_VALNAME, (ncm).lfMenuFont);\
1461test_reg_font( SPI_METRIC_REGKEY, SPI_CAPTIONFONT_VALNAME, (ncm).lfCaptionFont);\
1462test_reg_font( SPI_METRIC_REGKEY, SPI_SMCAPTIONFONT_VALNAME, (ncm).lfSmCaptionFont);\
1463test_reg_font( SPI_METRIC_REGKEY, SPI_STATUSFONT_VALNAME, (ncm).lfStatusFont);\
1464test_reg_font( SPI_METRIC_REGKEY, SPI_MESSAGEFONT_VALNAME, (ncm).lfMessageFont); } while(0)
1476 return tm.tmHeight + (
flag ?
tm.tmExternalLeading : 0);
1488 return tm.tmHeight + (
flag ?
tm.tmExternalLeading : 0);
1498 NONCLIENTMETRICSA Ncmorig;
1499 NONCLIENTMETRICSA Ncmnew;
1500 NONCLIENTMETRICSA Ncmcur;
1501 NONCLIENTMETRICSA Ncmstart;
1503 Ncmorig.cbSize =
FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth);
1504 Ncmnew.cbSize =
FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth);
1505 Ncmcur.cbSize =
FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth);
1506 Ncmstart.cbSize =
FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth);
1508 trace(
"testing SPI_{GET,SET}NONCLIENTMETRICS\n");
1529 Ncmnew.iBorderWidth += 1;
1530 Ncmnew.iScrollWidth += 1;
1531 Ncmnew.iScrollHeight -= 1;
1532 Ncmnew.iCaptionWidth -= 2;
1533 Ncmnew.iCaptionHeight += 2;
1534 Ncmnew.lfCaptionFont.lfHeight +=1;
1535 Ncmnew.lfCaptionFont.lfWidth +=2;
1536 Ncmnew.lfCaptionFont.lfWeight +=1;
1537 Ncmnew.iSmCaptionWidth += 1;
1538 Ncmnew.iSmCaptionHeight += 2;
1539 Ncmnew.lfSmCaptionFont.lfHeight +=3;
1540 Ncmnew.lfSmCaptionFont.lfWidth -=1;
1541 Ncmnew.lfSmCaptionFont.lfWeight +=3;
1542 Ncmnew.iMenuWidth += 1;
1543 Ncmnew.iMenuHeight += 2;
1544 Ncmnew.lfMenuFont.lfHeight +=1;
1545 Ncmnew.lfMenuFont.lfWidth +=1;
1546 Ncmnew.lfMenuFont.lfWeight +=2;
1547 Ncmnew.lfStatusFont.lfHeight -=1;
1548 Ncmnew.lfStatusFont.lfWidth -=1;
1549 Ncmnew.lfStatusFont.lfWeight +=3;
1550 Ncmnew.lfMessageFont.lfHeight -=2;
1551 Ncmnew.lfMessageFont.lfWidth -=1;
1552 Ncmnew.lfMessageFont.lfWeight +=4;
1557 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
1561 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
1569 Ncmnew.lfMenuFont.lfHeight -= 8;
1570 Ncmnew.lfCaptionFont.lfHeight =-4;
1571 Ncmnew.lfSmCaptionFont.lfHeight -=10;
1573 Ncmnew.iCaptionWidth = 0;
1574 Ncmnew.iCaptionHeight = 0;
1575 Ncmnew.iScrollHeight = 0;
1576 Ncmnew.iScrollWidth = 0;
1580 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
1586 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
1590 "MenuHeight: %d expected %d\n", Ncmcur.iMenuHeight,
expect);
1592 ok( Ncmcur.iCaptionHeight ==
expect,
1593 "CaptionHeight: %d expected %d\n", Ncmcur.iCaptionHeight,
expect);
1595 ok( Ncmcur.iSmCaptionHeight ==
expect,
1596 "SmCaptionHeight: %d expected %d\n", Ncmcur.iSmCaptionHeight,
expect);
1599 ok( (Ncmcur.iCaptionWidth >= 8 && Ncmcur.iCaptionWidth <= 13) ||
1600 Ncmcur.iCaptionWidth == Ncmstart.iCaptionWidth,
1601 "CaptionWidth: %d expected from [8, 13] or %d\n", Ncmcur.iCaptionWidth, Ncmstart.iCaptionWidth);
1602 ok( Ncmcur.iScrollWidth == 8,
1603 "ScrollWidth: %d expected 8\n", Ncmcur.iScrollWidth);
1604 ok( Ncmcur.iScrollHeight == 8,
1605 "ScrollHeight: %d expected 8\n", Ncmcur.iScrollHeight);
1612 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
1629 trace(
"testing SPI_{GET,SET}MINIMIZEDMETRICS\n");
1638 ok( regval == -1 || regval == lpMm_orig.
iWidth,
"wrong value in registry %d, expected %d\n",
1639 regval, lpMm_orig.
iWidth);
1641 ok( regval == -1 || regval == lpMm_orig.
iHorzGap,
"wrong value in registry %d, expected %d\n",
1644 ok( regval == -1 || regval == lpMm_orig.
iVertGap,
"wrong value in registry %d, expected %d\n",
1647 ok( regval == -1 || regval == lpMm_orig.
iArrange,
"wrong value in registry %d, expected %d\n",
1657 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
1660 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
1668 ok( regval == lpMm_new.
iWidth,
"wrong value in registry %d, expected %d\n",
1669 regval, lpMm_new.
iWidth);
1671 ok( regval == lpMm_new.
iHorzGap,
"wrong value in registry %d, expected %d\n",
1674 ok( regval == lpMm_new.
iVertGap,
"wrong value in registry %d, expected %d\n",
1677 ok( regval == lpMm_new.
iArrange,
"wrong value in registry %d, expected %d\n",
1681 lpMm_new.
iWidth,
"iWidth",
"%d" );
1683 lpMm_new.
iHorzGap,
"iHorzGap",
"%d" );
1685 lpMm_new.
iVertGap,
"iVertGap",
"%d" );
1687 lpMm_new.
iArrange,
"iArrange",
"%d" );
1695 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
1698 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
1700 eq( lpMm_new.
iWidth, 0,
"iWidth",
"%d" );
1701 eq( lpMm_new.
iHorzGap, 0,
"iHorzGap",
"%d" );
1702 eq( lpMm_new.
iVertGap, 0,
"iVertGap",
"%d" );
1709 ok( regval == lpMm_new.
iWidth,
"wrong value in registry %d, expected %d\n",
1710 regval, lpMm_new.
iWidth);
1712 ok( regval == lpMm_new.
iHorzGap,
"wrong value in registry %d, expected %d\n",
1715 ok( regval == lpMm_new.
iVertGap,
"wrong value in registry %d, expected %d\n",
1718 ok( regval == lpMm_new.
iArrange,
"wrong value in registry %d, expected %d\n",
1723 lpMm_new.
iWidth,
"iWidth",
"%d" );
1725 lpMm_new.
iHorzGap,
"iHorzGap",
"%d" );
1727 lpMm_new.
iVertGap,
"iVertGap",
"%d" );
1729 lpMm_new.
iArrange,
"iArrange",
"%d" );
1733 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
1736 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
1747 ICONMETRICSA im_orig;
1748 ICONMETRICSA im_new;
1749 ICONMETRICSA im_cur;
1752 im_orig.cbSize =
sizeof(ICONMETRICSA);
1753 im_new.cbSize =
sizeof(ICONMETRICSA);
1754 im_cur.cbSize =
sizeof(ICONMETRICSA);
1756 trace(
"testing SPI_{GET,SET}ICONMETRICS\n");
1763 ok( regval==im_orig.iHorzSpacing,
1764 "wrong value in registry %d, expected %d\n", regval, im_orig.iHorzSpacing);
1766 ok( regval==im_orig.iVertSpacing,
1767 "wrong value in registry %d, expected %d\n", regval, im_orig.iVertSpacing);
1769 if( regval != im_orig.iTitleWrap)
1771 ok( regval==im_orig.iTitleWrap,
"wrong value in registry %d, expected %d\n", regval, im_orig.iTitleWrap);
1776 im_cur.iHorzSpacing += 10;
1777 im_cur.iVertSpacing += 6;
1778 im_cur.iTitleWrap = !im_cur.iTitleWrap;
1779 im_cur.lfFont.lfHeight += 1;
1780 im_cur.lfFont.lfWidth += 2;
1781 im_cur.lfFont.lfEscapement = 1;
1782 im_cur.lfFont.lfWeight = im_cur.lfFont.lfWeight > 100 ? 1 : 314;
1783 im_cur.lfFont.lfItalic = !im_cur.lfFont.lfItalic;
1784 im_cur.lfFont.lfStrikeOut = !im_cur.lfFont.lfStrikeOut;
1785 im_cur.lfFont.lfUnderline = !im_cur.lfFont.lfUnderline;
1786 im_cur.lfFont.lfCharSet = im_cur.lfFont.lfCharSet ? 0 : 1;
1790 im_cur.lfFont.lfPitchAndFamily = im_cur.lfFont.lfPitchAndFamily ? 0 : 1;
1791 im_cur.lfFont.lfQuality = im_cur.lfFont.lfQuality ==
DEFAULT_QUALITY ?
1793 if(
strcmp( im_cur.lfFont.lfFaceName,
"MS Serif"))
1794 strcpy( im_cur.lfFont.lfFaceName,
"MS Serif");
1796 strcpy( im_cur.lfFont.lfFaceName,
"MS Sans Serif");
1800 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
1803 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
1805 eq( im_new.iHorzSpacing, im_cur.iHorzSpacing,
"iHorzSpacing",
"%d" );
1806 eq( im_new.iVertSpacing, im_cur.iVertSpacing,
"iVertSpacing",
"%d" );
1807 eq( im_new.iTitleWrap, im_cur.iTitleWrap,
"iTitleWrap",
"%d" );
1808 eq( im_new.lfFont.lfHeight, im_cur.lfFont.lfHeight,
"lfHeight",
"%d" );
1809 eq( im_new.lfFont.lfWidth, im_cur.lfFont.lfWidth,
"lfWidth",
"%d" );
1810 eq( im_new.lfFont.lfEscapement, im_cur.lfFont.lfEscapement,
"lfEscapement",
"%d" );
1811 eq( im_new.lfFont.lfWeight, im_cur.lfFont.lfWeight,
"lfWeight",
"%d" );
1812 eq( im_new.lfFont.lfItalic, im_cur.lfFont.lfItalic,
"lfItalic",
"%d" );
1813 eq( im_new.lfFont.lfStrikeOut, im_cur.lfFont.lfStrikeOut,
"lfStrikeOut",
"%d" );
1814 eq( im_new.lfFont.lfUnderline, im_cur.lfFont.lfUnderline,
"lfUnderline",
"%d" );
1815 eq( im_new.lfFont.lfCharSet, im_cur.lfFont.lfCharSet,
"lfCharSet",
"%d" );
1816 eq( im_new.lfFont.lfOutPrecision, im_cur.lfFont.lfOutPrecision,
"lfOutPrecision",
"%d" );
1817 eq( im_new.lfFont.lfClipPrecision, im_cur.lfFont.lfClipPrecision,
"lfClipPrecision",
"%d" );
1818 eq( im_new.lfFont.lfPitchAndFamily, im_cur.lfFont.lfPitchAndFamily,
"lfPitchAndFamily",
"%d" );
1819 eq( im_new.lfFont.lfQuality, im_cur.lfFont.lfQuality,
"lfQuality",
"%d" );
1820 ok( !
strcmp( im_new.lfFont.lfFaceName, im_cur.lfFont.lfFaceName),
1821 "wrong facename \"%s\", should be \"%s\"\n", im_new.lfFont.lfFaceName,
1822 im_cur.lfFont.lfFaceName);
1825 im_new.iHorzSpacing,
"iHorzSpacing",
"%d" );
1827 im_new.iVertSpacing,
"iVertSpacing",
"%d" );
1830 ok( regval==im_cur.iHorzSpacing,
"wrong value in registry %d, expected %d\n", regval, im_cur.iHorzSpacing);
1832 ok( regval==im_cur.iVertSpacing,
"wrong value in registry %d, expected %d\n", regval, im_cur.iVertSpacing);
1834 if( regval != im_cur.iTitleWrap)
1836 ok( regval==im_cur.iTitleWrap,
"wrong value in registry %d, expected %d\n", regval, im_cur.iTitleWrap);
1839 ok( rc && spacing == im_cur.iHorzSpacing,
1840 "SystemParametersInfoA( SPI_ICONHORIZONTALSPACING...) failed or returns wrong value %d instead of %d\n",
1841 spacing, im_cur.iHorzSpacing);
1843 ok( rc && spacing == im_cur.iVertSpacing,
1844 "SystemParametersInfoA( SPI_ICONVERTICALSPACING...) failed or returns wrong value %d instead of %d\n",
1845 spacing, im_cur.iVertSpacing);
1847 ok( rc &&
wrap == im_cur.iTitleWrap,
1848 "SystemParametersInfoA( SPI_GETICONTITLEWRAP...) failed or returns wrong value %d instead of %d\n",
1849 wrap, im_cur.iTitleWrap);
1852 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
1855 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
1857 eq( im_new.iHorzSpacing, im_orig.iHorzSpacing,
"iHorzSpacing",
"%d" );
1858 eq( im_new.iVertSpacing, im_orig.iVertSpacing,
"iVertSpacing",
"%d" );
1859 eq( im_new.iTitleWrap, im_orig.iTitleWrap,
"iTitleWrap",
"%d" );
1869 trace(
"testing SPI_{GET,SET}WORKAREA\n");
1885 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
1887 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
1890 eq(
area.left, curr_val.
left,
"left",
"%d" );
1891 eq(
area.top, curr_val.
top,
"top",
"%d" );
1894 "right: got %d instead of %d\n",
area.right, curr_val.
right );
1896 "bottom: got %d instead of %d\n",
area.bottom, curr_val.
bottom );
1900 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
1902 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
1905 eq(
area.left, old_area.
left,
"left",
"%d" );
1906 eq(
area.top, old_area.
top,
"top",
"%d" );
1909 "right: got %d instead of %d\n",
area.right, old_area.
right );
1911 "bottom: got %d instead of %d\n",
area.bottom, old_area.
bottom );
1921 trace(
"testing SPI_{GET,SET}SHOWSOUNDS\n");
1938 vals[
i] ?
"1" :
"0" );
1942 eq(
v, vals[
i],
"SPI_GETSHOWSOUNDS",
"%d" );
1944 "SM_SHOWSOUNDS",
"%d" );
1948 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
1958 trace(
"testing SPI_{GET,SET}KEYBOARDPREF\n");
1975 vals[
i] ?
"1" :
"0" );
1979 eq(
v, (
BOOL)vals[
i],
"SPI_GETKEYBOARDPREF",
"%d" );
1983 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
1993 trace(
"testing SPI_{GET,SET}SCREENREADER\n");
2010 vals[
i] ?
"1" :
"0" );
2014 eq(
v, (
BOOL)vals[
i],
"SPI_GETSCREENREADER",
"%d" );
2018 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
2025 DWORD old_type, old_contrast, old_orient;
2026 const UINT vals[]={0xffffffff,0,1,2};
2029 trace(
"testing SPI_{GET,SET}FONTSMOOTHING\n");
2049 vals[
i] ?
"2" :
"0" );
2069 if (!
test_error_msg(rc,
"SPI_SETFONTSMOOTHINGORIENTATION"))
return;
2077 eq(
v, vals[
i] ? 1 : 0,
"SPI_GETFONTSMOOTHING",
"%d" );
2081 ok(
v == vals[
i],
"wrong value %x/%x\n",
v, vals[
i] );
2085 ok(
v == vals[
i],
"wrong value %x/%x\n",
v, vals[
i] );
2089 ok(
v == vals[
i],
"wrong value %x/%x\n",
v, vals[
i] );
2093 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
2095 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
2097 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
2099 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
2109 trace(
"testing SPI_{GET,SET}LOWPOWERACTIVE\n");
2126 vals[
i] ?
"1" :
"0" );
2132 ok(
v == vals[
i] ||
v == 0,
2133 "SPI_GETLOWPOWERACTIVE: got %d instead of 0 or %d\n",
v, vals[
i]);
2137 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
2147 trace(
"testing SPI_{GET,SET}POWEROFFACTIVE\n");
2164 vals[
i] ?
"1" :
"0" );
2170 ok(
v == vals[
i] ||
v == 0,
2171 "SPI_GETPOWEROFFACTIVE: got %d instead of 0 or %d\n",
v, vals[
i]);
2175 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
2185 trace(
"testing SPI_{GET,SET}SNAPTODEFBUTTON\n");
2202 vals[
i] ?
"1" :
"0" );
2206 eq(
v, vals[
i],
"SPI_GETSNAPTODEFBUTTON",
"%d" );
2210 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
2217 const UINT vals[]={0,32767};
2220 trace(
"testing SPI_{GET,SET}MOUSEHOVERWIDTH\n");
2242 eq(
v, vals[
i],
"SPI_{GET,SET}MOUSEHOVERWIDTH",
"%d" );
2247 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
2254 const UINT vals[]={0,32767};
2257 trace(
"testing SPI_{GET,SET}MOUSEHOVERHEIGHT\n");
2279 eq(
v, vals[
i],
"SPI_{GET,SET}MOUSEHOVERHEIGHT",
"%d" );
2284 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
2295 const UINT vals[]={10,32767};
2298 trace(
"testing SPI_{GET,SET}MOUSEHOVERTIME\n");
2320 eq(
v, vals[
i],
"SPI_{GET,SET}MOUSEHOVERTIME",
"%d" );
2325 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
2332 const UINT vals[]={0,32767};
2335 trace(
"testing SPI_{GET,SET}WHEELSCROLLLINES\n");
2359 eq(
v, vals[
i],
"SPI_{GET,SET}WHEELSCROLLLINES",
"%d" );
2364 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
2371 const UINT vals[]={0,32767};
2374 trace(
"testing SPI_{GET,SET}MENUSHOWDELAY\n");
2398 eq(
v, vals[
i],
"SPI_{GET,SET}MENUSHOWDELAY",
"%d" );
2403 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
2410 const UINT vals[]={32767,0};
2413 trace(
"testing SPI_{GET,SET}WHEELSCROLLCHARS\n");
2436 eq(
v, vals[
i],
"SPI_{GET,SET}WHEELSCROLLCHARS",
"%d" );
2441 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
2450 trace(
"testing SPI_{GET,SET}DESKWALLPAPER\n");
2459 ok(rc,
"SystemParametersInfoA: rc=%d err=%d\n", rc,
GetLastError());
2463 ok(rc,
"***warning*** failed to restore the original value: rc=%d err=%d\n", rc,
GetLastError());
2471 int start_bpp, last_set_bpp = 0;
2472 int test_bpps[] = {8, 16, 24, 32},
i;
2476 if (!pChangeDisplaySettingsExA)
2478 win_skip(
"ChangeDisplaySettingsExA is not available\n");
2484 memset(&startmode, 0,
sizeof(startmode));
2485 startmode.
dmSize =
sizeof(startmode);
2497 mode.dmBitsPerPel = test_bpps[
i];
2508 if (wait_ret ==
WAIT_TIMEOUT && !last_set_bpp && start_bpp == test_bpps[
i])
2510 ok(wait_ret ==
WAIT_OBJECT_0,
"Waiting for the WM_DISPLAYCHANGE message timed out\n");
2515 skip(
"Setting depth %d failed(ret = %d)\n", test_bpps[
i], change_ret);
2516 ok(
last_bpp == -1,
"WM_DISPLAYCHANGE was sent with wParam %d despite mode change failure\n",
last_bpp);
2521 ok(
last_bpp == test_bpps[
i],
"Set bpp %d, but WM_DISPLAYCHANGE reported bpp %d\n", test_bpps[
i],
last_bpp);
2523 last_set_bpp = test_bpps[
i];
2526 if(start_bpp != last_set_bpp && last_set_bpp != 0) {
2530 mode.dmBitsPerPel = start_bpp;
2611 static const CHAR alphabet[] = {
2612 'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i',
'j',
'k',
'l',
'm',
'n',
'o',
'p',
'q',
2613 'r',
's',
't',
'u',
'v',
'w',
'x',
'y',
'z',
'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
2614 'I',
'J',
'K',
'L',
'M',
'N',
'O',
'P',
'Q',
'R',
'S',
'T',
'U',
'V',
'W',
'X',
'Y',
'Z',0};
2621 return (sz.
cx / 26 + 1) / 2;
2630 if( !ptm) ptm = &
tm;
2648#define ok_gsm( i, e)\
2651 int act = GetSystemMetrics( (i));\
2652 if( exp != act) gsm_error_ctr++;\
2653 ok( !( exp != act),"GetSystemMetrics(%s): expected %d actual %d\n", #i, exp,act);\
2655#define ok_gsm_2( i, e1, e2)\
2659 int act = GetSystemMetrics( (i));\
2660 if( exp1 != act && exp2 != act) gsm_error_ctr++;\
2661 ok( !( exp1 != act && exp2 != act), "GetSystemMetrics(%s): expected %d or %d actual %d\n", #i, exp1, exp2, act);\
2663#define ok_gsm_3( i, e1, e2, e3)\
2668 int act = GetSystemMetrics( (i));\
2669 if( exp1 != act && exp2 != act && exp3 != act) gsm_error_ctr++;\
2670 ok( !( exp1 != act && exp2 != act && exp3 != act),"GetSystemMetrics(%s): expected %d or %d or %d actual %d\n", #i, exp1, exp2, exp3, act);\
2693 if (
size >= 64)
return 64;
2694 if (
size >= 48)
return 48;
2701 UINT IconSpacing, IconVerticalSpacing;
2706 INT CaptionWidthfromreg, smicon, broken_val;
2708 NONCLIENTMETRICSA ncm;
2711 assert(
sizeof(ncm) == 344);
2713 ncm.cbSize =
FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth);
2715 ok(rc,
"SystemParametersInfoA failed\n");
2717 ncm.cbSize =
FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth) - 1;
2719 ok(!rc,
"SystemParametersInfoA should fail\n");
2721 ncm.cbSize =
FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth) + 1;
2724 ok(!rc,
"SystemParametersInfoA should fail\n");
2726 ncm.cbSize =
sizeof(ncm);
2728 ncm.iPaddedBorderWidth = 0xcccc;
2730 ok(rc ||
broken(!rc) ,
"SystemParametersInfoA failed\n");
2731 if (rc)
ok( ncm.iPaddedBorderWidth == 0,
"wrong iPaddedBorderWidth %u\n", ncm.iPaddedBorderWidth );
2733 minim.
cbSize =
sizeof( minim);
2734 ncm.cbSize =
FIELD_OFFSET(NONCLIENTMETRICSA, iPaddedBorderWidth);
2738 win_skip(
"SPI_GETNONCLIENTMETRICS is not available\n");
2742 ok(
is_font_enumerated(ncm.lfCaptionFont.lfFaceName),
"font %s should be enumerated\n", ncm.lfCaptionFont.lfFaceName);
2743 ok(
is_font_enumerated(ncm.lfSmCaptionFont.lfFaceName),
"font %s should be enumerated\n", ncm.lfSmCaptionFont.lfFaceName);
2744 ok(
is_font_enumerated(ncm.lfMenuFont.lfFaceName),
"font %s should be enumerated\n", ncm.lfMenuFont.lfFaceName);
2745 ok(
is_font_enumerated(ncm.lfStatusFont.lfFaceName),
"font %s should be enumerated\n", ncm.lfStatusFont.lfFaceName);
2746 ok(
is_font_enumerated(ncm.lfMessageFont.lfFaceName),
"font %s should be enumerated\n", ncm.lfMessageFont.lfFaceName);
2751 "Control Panel\\Desktop\\WindowMetrics",
"CaptionWidth",
dpi);
2756 IconVerticalSpacing = 0;
2795 ok_gsm(
SM_CXMIN, 3 *
max( CaptionWidthfromreg >= 0 ? CaptionWidthfromreg : ncm.iCaptionWidth, 8) +
2824 if (!pIsProcessDPIAware || pIsProcessDPIAware())
2825 smicon =
max(
min( smicon, CaptionWidthfromreg - 2), 4 ) & ~1;
2828 broken_val = (
min( ncm.iCaptionHeight, CaptionWidthfromreg ) - 2) & ~1;
2829 broken_val =
min( broken_val, 20 );
2836 else if (smicon < broken_val)
2850 ncm.iSmCaptionWidth,
2907 trace(
"BorderWidth %d CaptionWidth %d CaptionHeight %d IconSpacing %d IconVerticalSpacing %d\n",
2908 ncm.iBorderWidth, ncm.iCaptionWidth, ncm.iCaptionHeight, IconSpacing, IconVerticalSpacing);
2909 trace(
"MenuHeight %d MenuWidth %d ScrollHeight %d ScrollWidth %d SmCaptionHeight %d SmCaptionWidth %d\n",
2910 ncm.iMenuHeight, ncm.iMenuWidth, ncm.iScrollHeight, ncm.iScrollWidth, ncm.iSmCaptionHeight, ncm.iSmCaptionWidth);
2911 trace(
"Captionfontchar width %d MenuFont %d,%d CaptionWidth from registry: %d screen %d,%d\n",
2934 NONCLIENTMETRICSW ncm1, ncm2;
2935 ICONMETRICSW im1, im2;
2939 if (!pSystemParametersInfoForDpi)
2941 win_skip(
"custom dpi metrics not supported\n" );
2945 ncm1.cbSize =
sizeof(ncm1);
2948 ncm2.cbSize =
sizeof(ncm2);
2949 ret = pSystemParametersInfoForDpi( SPI_GETNONCLIENTMETRICS,
sizeof(ncm2), &ncm2,
FALSE, custom_dpi );
2952 for (
i = 0;
i < 92;
i++)
2955 int ret2 = pGetSystemMetricsForDpi(
i, custom_dpi );
2972 ok( ret1 ==
MulDiv( ret2,
dpi, custom_dpi ),
"%u: wrong value %u vs %u\n",
i, ret1, ret2 );
2975 ok( ret1 == ncm1.iCaptionWidth && ret2 == ncm2.iCaptionWidth,
2976 "%u: wrong value %u vs %u caption %u vs %u\n",
2977 i, ret1, ret2, ncm1.iCaptionWidth, ncm2.iCaptionWidth );
2983 else if (
val < 64)
val = 48;
2985 ok(
val == ret2,
"%u: wrong value %u vs %u\n",
i, ret1, ret2 );
2990 ok( ret1 - 1 ==
MulDiv( ret2 - 1,
dpi, custom_dpi ),
"%u: wrong value %u vs %u\n",
i, ret1, ret2 );
2993 ok( ret1 / 8 ==
MulDiv( ret2,
dpi, custom_dpi ) / 8,
"%u: wrong value %u vs %u\n",
i, ret1, ret2 );
2997 ok( ret1 == ncm1.iBorderWidth + 3 && ret2 == ncm2.iBorderWidth + 3,
2998 "%u: wrong value %u vs %u borders %u+%u vs %u+%u\n",
i, ret1, ret2,
2999 ncm1.iBorderWidth, ncm1.iPaddedBorderWidth, ncm2.iBorderWidth, ncm2.iPaddedBorderWidth );
3005 "%u: wrong value %u vs %u\n",
i, ret1, ret2 );
3011 "%u: wrong value %u vs %u font %u vs %u\n",
i, ret1, ret2,
3015 ok( ret1 == ret2,
"%u: wrong value %u vs %u\n",
i, ret1, ret2 );
3019 im1.cbSize =
sizeof(im1);
3022 im2.cbSize =
sizeof(im2);
3023 ret = pSystemParametersInfoForDpi( SPI_GETICONMETRICS,
sizeof(im2), &im2,
FALSE, custom_dpi );
3025 ok( im1.iHorzSpacing ==
MulDiv( im2.iHorzSpacing,
dpi, custom_dpi ),
"wrong iHorzSpacing %u vs %u\n",
3026 im1.iHorzSpacing, im2.iHorzSpacing );
3027 ok( im1.iVertSpacing ==
MulDiv( im2.iVertSpacing,
dpi, custom_dpi ),
"wrong iVertSpacing %u vs %u\n",
3028 im1.iVertSpacing, im2.iVertSpacing );
3029 ok( im1.iTitleWrap == im2.iTitleWrap,
"wrong iTitleWrap %u vs %u\n",
3030 im1.iTitleWrap, im2.iTitleWrap );
3040 ok( ncm1.iBorderWidth + ncm1.iPaddedBorderWidth ==
MulDiv( ncm2.iBorderWidth + ncm2.iPaddedBorderWidth,
dpi, custom_dpi ),
3041 "wrong iBorderWidth %u+%u vs %u+%u\n",
3042 ncm1.iBorderWidth, ncm1.iPaddedBorderWidth, ncm2.iBorderWidth, ncm2.iPaddedBorderWidth );
3043 ok( ncm1.iScrollWidth ==
MulDiv( ncm2.iScrollWidth,
dpi, custom_dpi ),
3044 "wrong iScrollWidth %u vs %u\n", ncm1.iScrollWidth, ncm2.iScrollWidth );
3045 ok( ncm1.iScrollHeight ==
MulDiv( ncm2.iScrollHeight,
dpi, custom_dpi ),
3046 "wrong iScrollHeight %u vs %u\n", ncm1.iScrollHeight, ncm2.iScrollHeight );
3047 ok( ((ncm1.iCaptionWidth + 1) & ~1) == ((
MulDiv( ncm2.iCaptionWidth,
dpi, custom_dpi ) + 1) & ~1),
3048 "wrong iCaptionWidth %u vs %u\n", ncm1.iCaptionWidth, ncm2.iCaptionWidth );
3049 ok( ncm1.iCaptionHeight ==
MulDiv( ncm2.iCaptionHeight,
dpi, custom_dpi ),
3050 "wrong iCaptionHeight %u vs %u\n", ncm1.iCaptionHeight, ncm2.iCaptionHeight );
3051 compare_font( &ncm1.lfCaptionFont, &ncm2.lfCaptionFont,
dpi, custom_dpi, __LINE__ );
3052 ok( ncm1.iSmCaptionHeight ==
MulDiv( ncm2.iSmCaptionHeight,
dpi, custom_dpi ),
3053 "wrong iSmCaptionHeight %u vs %u\n", ncm1.iSmCaptionHeight, ncm2.iSmCaptionHeight );
3054 compare_font( &ncm1.lfSmCaptionFont, &ncm2.lfSmCaptionFont,
dpi, custom_dpi, __LINE__ );
3055 ok( ncm1.iMenuHeight ==
MulDiv( ncm2.iMenuHeight,
dpi, custom_dpi ),
3056 "wrong iMenuHeight %u vs %u\n", ncm1.iMenuHeight, ncm2.iMenuHeight );
3058 ok( ncm1.iSmCaptionWidth / 8 ==
MulDiv( ncm2.iSmCaptionWidth,
dpi, custom_dpi ) / 8,
3059 "wrong iSmCaptionWidth %u vs %u\n", ncm1.iSmCaptionWidth, ncm2.iSmCaptionWidth );
3060 ok( ncm1.iMenuWidth / 8 ==
MulDiv( ncm2.iMenuWidth,
dpi, custom_dpi ) / 8,
3061 "wrong iMenuWidth %u vs %u\n", ncm1.iMenuWidth, ncm2.iMenuWidth );
3062 compare_font( &ncm1.lfMenuFont, &ncm2.lfMenuFont,
dpi, custom_dpi, __LINE__ );
3063 compare_font( &ncm1.lfStatusFont, &ncm2.lfStatusFont,
dpi, custom_dpi, __LINE__ );
3064 compare_font( &ncm1.lfMessageFont, &ncm2.lfMessageFont,
dpi, custom_dpi, __LINE__ );
3066 for (
i = 1;
i < 120;
i++)
3071 ret = pSystemParametersInfoForDpi(
i, 0, &
val, 0, custom_dpi );
3072 ok( !
ret,
"%u: SystemParametersInfoForDpi succeeded\n",
i );
3090 "GetDeviceCaps(BITSPIXEL) returned %d, EnumDisplaySettings returned %d\n",
3110 "Expected ERROR_NO_MORE_FILES, ERROR_MOD_NOT_FOUND or 0xdeadbeef, got %d for %d\n", le,
num);
3123 ok(hbr ==
NULL,
"Expected NULL brush\n");
3131 ok(hbr ==
NULL,
"Expected NULL brush\n");
3135 win_skip(
"COLOR_MENUBAR unsupported\n");
3148 ok( !pIsProcessDPIAware(),
"not aware\n" );
3154 ok( pIsProcessDPIAware(),
"not aware\n" );
3163 ok(
obj[
i] != obj2[
i],
"%u: same object\n",
i );
3167 ok(
obj[
i] != obj2[
i],
"%u: same object\n",
i );
3174 ok(
obj[
i] == obj2[
i],
"%u: different object\n",
i );
3179 pSetThreadDpiAwarenessContext(
context );
3184 pt->x =
MulDiv(
pt->x, target_dpi, src_dpi );
3185 pt->y =
MulDiv(
pt->y, target_dpi, src_dpi );
3227 if (!pLogicalToPhysicalPointForPerMonitorDPI)
3229 win_skip(
"LogicalToPhysicalPointForPerMonitorDPI not supported\n" );
3251 ok( monitor != 0,
"failed to get monitor\n" );
3252 mon_info.
cbSize =
sizeof(mon_info);
3261 ok(
EqualRect( &desktop, &
rect ),
"%lu: wrong caps virt desktop rect %s expected %s\n",
3314 "%lu/%lu: wrong placement min pos %d,%d expected %d,%d\n",
i,
j,
3319 "%lu/%lu: wrong placement max pos %d,%d expected %d,%d\n",
i,
j,
3324 "%lu/%lu: wrong placement rect %s expect %s\n",
i,
j,
3339 ok(
EqualRect( &desktop, &
rect ),
"%lu/%lu: wrong desktop resolution %s expected %s\n",