Correctly encode wParam for WM_SYSCOMMAND,SC_SIZE messages.

diff --git a/dlls/x11drv/winpos.c b/dlls/x11drv/winpos.c
index e31d09c..409b679 100644
--- a/dlls/x11drv/winpos.c
+++ b/dlls/x11drv/winpos.c
@@ -1901,7 +1901,8 @@
     else  /* SC_SIZE */
     {
         if (!thickframe) return;
-        if ( hittest && hittest != HTSYSMENU ) hittest += 2;
+        if ( hittest && ((wParam & 0xfff0) != SC_MOUSEMENU) )
+            hittest += (HTLEFT - WMSZ_LEFT);
         else
         {
             set_movesize_capture( hwnd );
diff --git a/windows/nonclient.c b/windows/nonclient.c
index c7e78cc..354e0eb 100644
--- a/windows/nonclient.c
+++ b/windows/nonclient.c
@@ -2071,8 +2071,15 @@
     case HTBOTTOM:
     case HTBOTTOMLEFT:
     case HTBOTTOMRIGHT:
-	/* make sure hittest fits into 0xf and doesn't overlap with HTSYSMENU */
-	SendMessageW( hwnd, WM_SYSCOMMAND, SC_SIZE + wParam - 2, lParam);
+        /* Old comment:
+         * "make sure hittest fits into 0xf and doesn't overlap with HTSYSMENU"
+         * This was previously done by setting wParam=SC_SIZE + wParam - 2
+         */
+        /* But that is not what WinNT does. Instead it sends this. This
+         * is easy to differentiate from HTSYSMENU, because HTSYSMENU adds
+         * SC_MOUSEMENU into wParam.
+         */
+        SendMessageW( hwnd, WM_SYSCOMMAND, SC_SIZE + wParam - (HTLEFT-WMSZ_LEFT), lParam);
 	break;
 
     case HTBORDER: