Author: jimtabor Date: Wed Jul 2 23:51:51 2008 New Revision: 34270
URL: http://svn.reactos.org/svn/reactos?rev=34270&view=rev Log: Bug 972: - Fixes the problem of selecting Explorer START menu than mouse over and clicking another application. - Doesn't fix the problem of selecting Explorer START menu than mouse over to the opened file Explorer and clicking on it. - Why, one might ask? The file Explorer shares the same TID.
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/focus.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/focus.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/focus.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/focus.c [iso-8859-1] Wed Jul 2 23:51:51 2008 @@ -96,6 +96,42 @@ MAKEWPARAM(MouseActivate ? WA_CLICKACTIVE : WA_ACTIVE, UserGetWindowLong(hWnd, GWL_STYLE, FALSE) & WS_MINIMIZE), (LPARAM)hWndPrev); + + if (Window && hWndPrev) + { + PWINDOW_OBJECT cWindow; + HWND *List, *phWnd; + HANDLE OldTID = IntGetWndThreadId(UserGetWindowObject(hWndPrev)); + HANDLE NewTID = IntGetWndThreadId(Window); + + DPRINT("SendActiveMessage Old -> %x, New -> %x\n", OldTID, NewTID); + + if (OldTID != NewTID) + { + if ((List = IntWinListChildren(UserGetWindowObject(IntGetDesktopWindow())))) + { + for (phWnd = List; *phWnd; ++phWnd) + { + cWindow = UserGetWindowObject(*phWnd); + if (cWindow && (IntGetWndThreadId(cWindow) == OldTID)) + { // FALSE if the window is being deactivated, + // ThreadId that owns the window being activated. + co_IntSendMessage(*phWnd, WM_ACTIVATEAPP, FALSE, (LPARAM)NewTID); + } + } + for (phWnd = List; *phWnd; ++phWnd) + { + cWindow = UserGetWindowObject(*phWnd); + if (cWindow && (IntGetWndThreadId(cWindow) == NewTID)) + { // TRUE if the window is being activated, + // ThreadId that owns the window being deactivated. + co_IntSendMessage(*phWnd, WM_ACTIVATEAPP, TRUE, (LPARAM)OldTID); + } + } + ExFreePool(List); + } + } + } } }