[NtUser]
authorJames Tabor <james.tabor@reactos.org>
Tue, 20 Sep 2016 02:00:18 +0000 (02:00 +0000)
committerJames Tabor <james.tabor@reactos.org>
Tue, 20 Sep 2016 02:00:18 +0000 (02:00 +0000)
- Use send message only and fix return for WM_NC/ACTIVATE. See CORE-11979 and CORE-11324.

svn path=/trunk/; revision=72745

reactos/win32ss/user/ntuser/focus.c
reactos/win32ss/user/ntuser/nonclient.c
reactos/win32ss/user/ntuser/winpos.c

index 7b98458..0392eb2 100644 (file)
@@ -54,14 +54,15 @@ co_IntSendDeactivateMessages(HWND hWndPrev, HWND hWnd)
    USER_REFERENCE_ENTRY RefPrev;
    PWND WndPrev;
    BOOL Ret = TRUE;
+   LPARAM lParam = hWnd ? (LPARAM)hWnd : 0;
 
    if (hWndPrev && (WndPrev = ValidateHwndNoErr(hWndPrev)))
    {
       UserRefObjectCo(WndPrev, &RefPrev);
 
-      if (co_IntSendMessageNoWait(hWndPrev, WM_NCACTIVATE, FALSE, 0)) //(LPARAM)hWnd))
+      if (co_IntSendMessage(hWndPrev, WM_NCACTIVATE, FALSE, lParam))
       {
-         co_IntSendMessageNoWait(hWndPrev, WM_ACTIVATE,
+         co_IntSendMessage(hWndPrev, WM_ACTIVATE,
                     MAKEWPARAM(WA_INACTIVE, (WndPrev->style & WS_MINIMIZE) != 0),
                     (LPARAM)hWnd);
 
@@ -241,7 +242,7 @@ co_IntSendActivateMessages(PWND WindowPrev, PWND Window, BOOL MouseActivate, BOO
 
       co_IntMakeWindowActive(Window);
 
-      co_IntSendMessageNoWait( UserHMGetHandle(Window),
+      co_IntSendMessage( UserHMGetHandle(Window),
                                WM_NCACTIVATE,
                               (WPARAM)(Window == (gpqForeground ? gpqForeground->spwndActive : NULL)),
                                0); //(LPARAM)hWndPrev);
index 550559f..81b91ac 100644 (file)
@@ -1378,7 +1378,7 @@ LRESULT NC_HandleNCActivate( PWND Wnd, WPARAM wParam, LPARAM lParam )
    }
 
    if ((Wnd->state & WNDS_NONCPAINT) || !(Wnd->style & WS_VISIBLE))
-      return 0;
+      return TRUE;
 
    /* This isn't documented but is reproducible in at least XP SP2 and
     * Outlook 2007 depends on it
index 44def17..b987ff7 100644 (file)
@@ -2612,7 +2612,7 @@ co_WinPosShowWindow(PWND Wnd, INT Cmd)
    {
       co_UserSetFocus(Wnd);
       // Fix wine Win test_SetFocus todo #3,
-      if (!(style & WS_CHILD)) co_IntSendMessageNoWait(UserHMGetHandle(Wnd), WM_ACTIVATE, WA_ACTIVE, 0);
+      if (!(style & WS_CHILD)) co_IntSendMessage(UserHMGetHandle(Wnd), WM_ACTIVATE, WA_ACTIVE, 0);
    }
    //ERR("co_WinPosShowWindow EXIT\n");
    return WasVisible;