- Make WinPosSearchChildren more readable.

svn path=/trunk/; revision=9374
This commit is contained in:
Filip Navara 2004-05-13 20:46:28 +00:00
parent 63c655e5d1
commit 41df8b886e

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: winpos.c,v 1.114 2004/05/10 17:07:18 weiden Exp $ /* $Id: winpos.c,v 1.115 2004/05/13 20:46:28 navaraf Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -1350,8 +1350,9 @@ WinPosShowWindow(HWND Wnd, INT Cmd)
return(WasVisible); return(WasVisible);
} }
VOID STATIC FASTCALL STATIC VOID FASTCALL
WinPosSearchChildren(PWINDOW_OBJECT ScopeWin, PUSER_MESSAGE_QUEUE OnlyHitTests, POINT *Point, WinPosSearchChildren(
PWINDOW_OBJECT ScopeWin, PUSER_MESSAGE_QUEUE OnlyHitTests, POINT *Point,
PWINDOW_OBJECT* Window, USHORT *HitTest) PWINDOW_OBJECT* Window, USHORT *HitTest)
{ {
PWINDOW_OBJECT Current; PWINDOW_OBJECT Current;
@ -1359,28 +1360,35 @@ WinPosSearchChildren(PWINDOW_OBJECT ScopeWin, PUSER_MESSAGE_QUEUE OnlyHitTests,
if ((List = IntWinListChildren(ScopeWin))) if ((List = IntWinListChildren(ScopeWin)))
{ {
for(phWnd = List; *phWnd; ++phWnd) for (phWnd = List; *phWnd; ++phWnd, IntReleaseWindowObject(Current))
{ {
if (!(Current = IntGetWindowObject(*phWnd))) if (!(Current = IntGetWindowObject(*phWnd)))
{
continue; continue;
}
if (Current->Style & WS_VISIBLE && if (!(Current->Style & WS_VISIBLE))
(!(Current->Style & WS_DISABLED) || (Current->Style & (WS_CHILD | WS_POPUP)) != WS_CHILD) && continue;
IntPtInWindow(Current, Point->x, Point->y))
{ if ((Current->Style & (WS_POPUP | WS_CHILD | WS_DISABLED)) ==
(WS_CHILD | WS_DISABLED))
continue;
if (!IntPtInWindow(Current, Point->x, Point->y))
continue;
if (*Window) if (*Window)
{
IntReleaseWindowObject(*Window); IntReleaseWindowObject(*Window);
}
*Window = Current; *Window = Current;
if (Current->Style & WS_MINIMIZE)
{
*HitTest = HTCAPTION;
break;
}
if (Current->Style & WS_DISABLED) if (Current->Style & WS_DISABLED)
{ {
*HitTest = HTERROR; *HitTest = HTERROR;
ExFreePool(List); break;
return;
} }
if (OnlyHitTests && (Current->MessageQueue == OnlyHitTests)) if (OnlyHitTests && (Current->MessageQueue == OnlyHitTests))
@ -1388,14 +1396,10 @@ WinPosSearchChildren(PWINDOW_OBJECT ScopeWin, PUSER_MESSAGE_QUEUE OnlyHitTests,
*HitTest = IntSendMessage(Current->Self, WM_NCHITTEST, 0, *HitTest = IntSendMessage(Current->Self, WM_NCHITTEST, 0,
MAKELONG(Point->x, Point->y)); MAKELONG(Point->x, Point->y));
if ((*HitTest) == (USHORT)HTTRANSPARENT) if ((*HitTest) == (USHORT)HTTRANSPARENT)
{
continue; continue;
} }
}
else else
{
*HitTest = HTCLIENT; *HitTest = HTCLIENT;
}
if (Point->x >= Current->ClientRect.left && if (Point->x >= Current->ClientRect.left &&
Point->x < Current->ClientRect.right && Point->x < Current->ClientRect.right &&
@ -1403,14 +1407,9 @@ WinPosSearchChildren(PWINDOW_OBJECT ScopeWin, PUSER_MESSAGE_QUEUE OnlyHitTests,
Point->y < Current->ClientRect.bottom) Point->y < Current->ClientRect.bottom)
{ {
WinPosSearchChildren(Current, OnlyHitTests, Point, Window, HitTest); WinPosSearchChildren(Current, OnlyHitTests, Point, Window, HitTest);
ExFreePool(List);
return;
} }
ExFreePool(List); break;
return;
}
IntReleaseWindowObject(Current);
} }
ExFreePool(List); ExFreePool(List);
} }