[Win32SS]
authorJames Tabor <james.tabor@reactos.org>
Sat, 1 Apr 2017 02:01:59 +0000 (02:01 +0000)
committerJames Tabor <james.tabor@reactos.org>
Sat, 1 Apr 2017 02:01:59 +0000 (02:01 +0000)
- Patch by Alex Henrie : Translate WM_(NC)XBUTTONUP to WM_APPCOMMAND in DefWindowProc.
- Modified for ReactOS.

svn path=/trunk/; revision=74258

reactos/win32ss/user/ntuser/defwnd.c
reactos/win32ss/user/user32/windows/defwnd.c

index e9db53f..f509473 100644 (file)
@@ -721,6 +721,16 @@ IntDefWindowProc(
            ERR("WM_NCRBUTTONUP\n");
           break;
 
            ERR("WM_NCRBUTTONUP\n");
           break;
 
+      case WM_XBUTTONUP:
+      case WM_NCXBUTTONUP:
+          if (HIWORD(wParam) == XBUTTON1 || HIWORD(wParam) == XBUTTON2)
+          {
+              co_IntSendMessage(UserHMGetHandle(Wnd), WM_APPCOMMAND, (WPARAM)UserHMGetHandle(Wnd),
+                                MAKELPARAM(LOWORD(wParam), FAPPCOMMAND_MOUSE | HIWORD(wParam)));
+          }
+          break;
+
+
       case WM_CONTEXTMENU:
       {
             if (Wnd->style & WS_CHILD)
       case WM_CONTEXTMENU:
       {
             if (Wnd->style & WS_CHILD)
index 383a0db..66753ce 100644 (file)
@@ -376,6 +376,15 @@ User32DefWindowProc(HWND hWnd,
            ERR("WM_NCRBUTTONUP\n");
             break;
 
            ERR("WM_NCRBUTTONUP\n");
             break;
 
+        case WM_XBUTTONUP:
+        case WM_NCXBUTTONUP:
+            if (HIWORD(wParam) == XBUTTON1 || HIWORD(wParam) == XBUTTON2)
+            {
+               SendMessageW(hWnd, WM_APPCOMMAND, (WPARAM)hWnd,
+                         MAKELPARAM(LOWORD(wParam), FAPPCOMMAND_MOUSE | HIWORD(wParam)));
+            }
+            break;
+
         case WM_CONTEXTMENU:
         {
             if (GetWindowLongPtrW(hWnd, GWL_STYLE) & WS_CHILD)
         case WM_CONTEXTMENU:
         {
             if (GetWindowLongPtrW(hWnd, GWL_STYLE) & WS_CHILD)