From e38d2daa326873ae8cc630e3e99d153bb9080f5c Mon Sep 17 00:00:00 2001 From: James Tabor Date: Tue, 20 Sep 2016 02:00:18 +0000 Subject: [PATCH] [NtUser] - 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 | 7 ++++--- reactos/win32ss/user/ntuser/nonclient.c | 2 +- reactos/win32ss/user/ntuser/winpos.c | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/reactos/win32ss/user/ntuser/focus.c b/reactos/win32ss/user/ntuser/focus.c index 7b98458914d..0392eb2b1c4 100644 --- a/reactos/win32ss/user/ntuser/focus.c +++ b/reactos/win32ss/user/ntuser/focus.c @@ -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); diff --git a/reactos/win32ss/user/ntuser/nonclient.c b/reactos/win32ss/user/ntuser/nonclient.c index 550559ff351..81b91acbebd 100644 --- a/reactos/win32ss/user/ntuser/nonclient.c +++ b/reactos/win32ss/user/ntuser/nonclient.c @@ -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 diff --git a/reactos/win32ss/user/ntuser/winpos.c b/reactos/win32ss/user/ntuser/winpos.c index 44def172d3c..b987ff7855b 100644 --- a/reactos/win32ss/user/ntuser/winpos.c +++ b/reactos/win32ss/user/ntuser/winpos.c @@ -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;