user32: Implemented processing SPI_{GET/SET}SNAPTODEFBUTTON for SystemParametersInfo.

This commit is contained in:
Vitaly Lipatov 2008-05-27 19:03:44 +04:00 committed by Alexandre Julliard
parent f16e49baf2
commit dfdb64c121
2 changed files with 55 additions and 2 deletions

View File

@ -77,6 +77,7 @@ enum spi_index
SPI_SETMENUSHOWDELAY_IDX,
SPI_SETICONTITLELOGFONT_IDX,
SPI_SETLOWPOWERACTIVE_IDX,
SPI_SETSNAPTODEFBUTTON_IDX,
SPI_SETPOWEROFFACTIVE_IDX,
SPI_USERPREFERENCEMASK_IDX,
SPI_NONCLIENTMETRICS_IDX,
@ -166,6 +167,8 @@ static const WCHAR SPI_SETMENUDROPALIGNMENT_REGKEY1[]= {'S','o','f','t','
'W','i','n','d','o','w','s',0};
static const WCHAR SPI_SETMENUDROPALIGNMENT_REGKEY2[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0};
static const WCHAR SPI_SETMENUDROPALIGNMENT_VALNAME[]= {'M','e','n','u','D','r','o','p','A','l','i','g','n','m','e','n','t',0};
static const WCHAR SPI_SETSNAPTODEFBUTTON_REGKEY[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','M','o','u','s','e',0};
static const WCHAR SPI_SETSNAPTODEFBUTTON_VALNAME[]= {'S','n','a','p','T','o','D','e','f','a','u','l','t','B','u','t','t','o','n',0};
static const WCHAR SPI_SETDOUBLECLKWIDTH_REGKEY1[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','M','o','u','s','e',0};
static const WCHAR SPI_SETDOUBLECLKWIDTH_REGKEY2[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0};
static const WCHAR SPI_SETDOUBLECLKWIDTH_VALNAME[]= {'D','o','u','b','l','e','C','l','i','c','k','W','i','d','t','h',0};
@ -298,6 +301,7 @@ static UINT font_smoothing = 0; /* 0x01 for 95/98/NT, 0x02 for 98/ME/2k/XP */
static BOOL lowpoweractive = FALSE;
static BOOL poweroffactive = FALSE;
static BOOL show_sounds = FALSE;
static BOOL snap_to_default_button = FALSE;
static BOOL swap_buttons = FALSE;
static UINT caret_width = 1;
static BYTE user_prefs[4];
@ -2016,8 +2020,20 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
WINE_SPI_FIXME(SPI_SETMOUSETRAILS); /* 93 WINVER >= 0x400 */
WINE_SPI_FIXME(SPI_GETMOUSETRAILS); /* 94 WINVER >= 0x400 */
WINE_SPI_FIXME(SPI_GETSNAPTODEFBUTTON); /* 95 WINVER >= 0x400 */
WINE_SPI_FIXME(SPI_SETSNAPTODEFBUTTON); /* 96 WINVER >= 0x400 */
case SPI_GETSNAPTODEFBUTTON: /* 95 WINVER >= 0x400 */
ret = get_bool_param( SPI_SETSNAPTODEFBUTTON_IDX,
SPI_SETSNAPTODEFBUTTON_REGKEY,
SPI_SETSNAPTODEFBUTTON_VALNAME,
&snap_to_default_button, pvParam );
break;
case SPI_SETSNAPTODEFBUTTON: /* 96 WINVER >= 0x400 */
ret = set_bool_param( SPI_SETSNAPTODEFBUTTON_IDX,
SPI_SETSNAPTODEFBUTTON_REGKEY,
SPI_SETSNAPTODEFBUTTON_VALNAME,
&snap_to_default_button, uiParam, fWinIni );
break;
case SPI_SETSCREENSAVERRUNNING:
ret = set_bool_param( SPI_SETSCREENSAVERRUNNING_IDX,

View File

@ -129,6 +129,8 @@ static HDC hdc;
#define SPI_SETPOWEROFFACTIVE_VALNAME "PowerOffActive"
#define SPI_SETDRAGFULLWINDOWS_REGKEY "Control Panel\\Desktop"
#define SPI_SETDRAGFULLWINDOWS_VALNAME "DragFullWindows"
#define SPI_SETSNAPTODEFBUTTON_REGKEY "Control Panel\\Mouse"
#define SPI_SETSNAPTODEFBUTTON_VALNAME "SnapToDefaultButton"
#define SPI_SETMOUSEHOVERWIDTH_REGKEY "Control Panel\\Mouse"
#define SPI_SETMOUSEHOVERWIDTH_VALNAME "MouseHoverWidth"
#define SPI_SETMOUSEHOVERHEIGHT_REGKEY "Control Panel\\Mouse"
@ -1966,6 +1968,40 @@ static void test_SPI_SETPOWEROFFACTIVE( void ) /* 86 */
ok(rc!=0,"***warning*** failed to restore the original value: rc=%d err=%d\n",rc,GetLastError());
}
static void test_SPI_SETSNAPTODEFBUTTON( void ) /* 95 */
{
BOOL rc;
BOOL old_b;
const UINT vals[]={TRUE,FALSE};
unsigned int i;
trace("testing SPI_{GET,SET}SNAPTODEFBUTTON\n");
SetLastError(0xdeadbeef);
rc=SystemParametersInfoA( SPI_GETSNAPTODEFBUTTON, 0, &old_b, 0 );
if (!test_error_msg(rc,"SPI_GETSNAPTODEFBUTTON"))
return;
for (i=0;i<sizeof(vals)/sizeof(*vals);i++)
{
UINT v;
rc=SystemParametersInfoA( SPI_SETSNAPTODEFBUTTON, vals[i], 0,
SPIF_UPDATEINIFILE | SPIF_SENDCHANGE );
ok(rc!=0,"%d: rc=%d err=%d\n",i,rc,GetLastError());
test_change_message( SPI_SETSNAPTODEFBUTTON, 0 );
test_reg_key( SPI_SETSNAPTODEFBUTTON_REGKEY,
SPI_SETSNAPTODEFBUTTON_VALNAME,
vals[i] ? "1" : "0" );
rc=SystemParametersInfoA( SPI_GETSNAPTODEFBUTTON, 0, &v, 0 );
ok(rc!=0,"%d: rc=%d err=%d\n",i,rc,GetLastError());
eq( v, vals[i], "SPI_GETSNAPTODEFBUTTON", "%d" );
}
rc=SystemParametersInfoA( SPI_SETSNAPTODEFBUTTON, old_b, 0, SPIF_UPDATEINIFILE );
ok(rc!=0,"***warning*** failed to restore the original value: rc=%d err=%d\n",rc,GetLastError());
}
static void test_SPI_SETMOUSEHOVERWIDTH( void ) /* 99 */
{
BOOL rc;
@ -2300,6 +2336,7 @@ static DWORD WINAPI SysParamsThreadFunc( LPVOID lpParam )
test_SPI_SETFONTSMOOTHING(); /* 75 */
test_SPI_SETLOWPOWERACTIVE(); /* 85 */
test_SPI_SETPOWEROFFACTIVE(); /* 86 */
test_SPI_SETSNAPTODEFBUTTON(); /* 95 */
test_SPI_SETMOUSEHOVERWIDTH(); /* 99 */
test_SPI_SETMOUSEHOVERHEIGHT(); /* 101 */
test_SPI_SETMOUSEHOVERTIME(); /* 103 */