---
 dlls/user32/sysparams.c       |   20 ++++++++++++++++++--
 dlls/user32/tests/sysparams.c |   37 +++++++++++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+), 2 deletions(-)

diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c
index ec7671f..b2b33db 100644
--- a/dlls/user32/sysparams.c
+++ b/dlls/user32/sysparams.c
@@ -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};
@@ -300,6 +303,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];
@@ -2032,8 +2036,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,
diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c
index 8e95ffd..31995c8 100644
--- a/dlls/user32/tests/sysparams.c
+++ b/dlls/user32/tests/sysparams.c
@@ -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"
@@ -1960,6 +1962,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;
@@ -2294,6 +2330,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 */
-- 
1.5.4.5.GIT

