mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 23:33:01 +00:00
[NtUser]
- Fix code duplication. svn path=/trunk/; revision=65504
This commit is contained in:
parent
39569fc498
commit
c3543f4697
1 changed files with 1 additions and 51 deletions
|
@ -178,7 +178,7 @@ co_IntSendActivateMessages(PWND WindowPrev, PWND Window, BOOL MouseActivate, BOO
|
||||||
//ERR("SendActivateMessage Old -> %x, New -> %x\n", OldTID, NewTID);
|
//ERR("SendActivateMessage Old -> %x, New -> %x\n", OldTID, NewTID);
|
||||||
|
|
||||||
if (!(pti->TIF_flags & TIF_INACTIVATEAPPMSG) &&
|
if (!(pti->TIF_flags & TIF_INACTIVATEAPPMSG) &&
|
||||||
(!WindowPrev || OldTID != NewTID) )
|
(OldTID != NewTID) )
|
||||||
{
|
{
|
||||||
PWND cWindow;
|
PWND cWindow;
|
||||||
HWND *List, *phWnd;
|
HWND *List, *phWnd;
|
||||||
|
@ -267,56 +267,6 @@ co_IntSendActivateMessages(PWND WindowPrev, PWND Window, BOOL MouseActivate, BOO
|
||||||
|
|
||||||
UserDerefObjectCo(Window);
|
UserDerefObjectCo(Window);
|
||||||
}
|
}
|
||||||
|
|
||||||
OldTID = WindowPrev ? IntGetWndThreadId(WindowPrev) : NULL;
|
|
||||||
NewTID = Window ? IntGetWndThreadId(Window) : NULL;
|
|
||||||
ptiOld = WindowPrev ? WindowPrev->head.pti : NULL;
|
|
||||||
ptiNew = Window ? Window->head.pti : NULL;
|
|
||||||
|
|
||||||
//ERR("SendActivateMessage WindowPrev -> %x, Old -> %x, New -> %x\n", WindowPrev, OldTID, NewTID);
|
|
||||||
|
|
||||||
if (!(pti->TIF_flags & TIF_INACTIVATEAPPMSG) &&
|
|
||||||
(OldTID != NewTID) )
|
|
||||||
{
|
|
||||||
PWND cWindow;
|
|
||||||
HWND *List, *phWnd;
|
|
||||||
|
|
||||||
List = IntWinListChildren(UserGetDesktopWindow());
|
|
||||||
if ( List )
|
|
||||||
{
|
|
||||||
if ( OldTID )
|
|
||||||
{
|
|
||||||
ptiOld->TIF_flags |= TIF_INACTIVATEAPPMSG;
|
|
||||||
// Note: Do not set pci flags, this does crash!
|
|
||||||
for (phWnd = List; *phWnd; ++phWnd)
|
|
||||||
{
|
|
||||||
cWindow = ValidateHwndNoErr(*phWnd);
|
|
||||||
if (cWindow && cWindow->head.pti == ptiOld)
|
|
||||||
{ // FALSE if the window is being deactivated,
|
|
||||||
// ThreadId that owns the window being activated.
|
|
||||||
co_IntSendMessageNoWait(*phWnd, WM_ACTIVATEAPP, FALSE, (LPARAM)NewTID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ptiOld->TIF_flags &= ~TIF_INACTIVATEAPPMSG;
|
|
||||||
}
|
|
||||||
if ( NewTID )
|
|
||||||
{ //// Prevents a resource crash due to reentrance!
|
|
||||||
InAAPM = TRUE;
|
|
||||||
pti->TIF_flags |= TIF_INACTIVATEAPPMSG;
|
|
||||||
////
|
|
||||||
for (phWnd = List; *phWnd; ++phWnd)
|
|
||||||
{
|
|
||||||
cWindow = ValidateHwndNoErr(*phWnd);
|
|
||||||
if (cWindow && cWindow->head.pti == ptiNew)
|
|
||||||
{ // TRUE if the window is being activated,
|
|
||||||
// ThreadId that owns the window being deactivated.
|
|
||||||
co_IntSendMessageNoWait(*phWnd, WM_ACTIVATEAPP, TRUE, (LPARAM)OldTID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ExFreePoolWithTag(List, USERTAG_WINDOWLIST);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return InAAPM;
|
return InAAPM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue