mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
- Make WinPosSearchChildren more readable.
svn path=/trunk/; revision=9374
This commit is contained in:
parent
63c655e5d1
commit
41df8b886e
1 changed files with 57 additions and 58 deletions
|
@ -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,70 +1350,69 @@ 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* Window, USHORT *HitTest)
|
PWINDOW_OBJECT ScopeWin, PUSER_MESSAGE_QUEUE OnlyHitTests, POINT *Point,
|
||||||
|
PWINDOW_OBJECT* Window, USHORT *HitTest)
|
||||||
{
|
{
|
||||||
PWINDOW_OBJECT Current;
|
PWINDOW_OBJECT Current;
|
||||||
HWND *List, *phWnd;
|
HWND *List, *phWnd;
|
||||||
|
|
||||||
if((List = IntWinListChildren(ScopeWin)))
|
if ((List = IntWinListChildren(ScopeWin)))
|
||||||
{
|
{
|
||||||
for(phWnd = List; *phWnd; ++phWnd)
|
for (phWnd = List; *phWnd; ++phWnd, IntReleaseWindowObject(Current))
|
||||||
{
|
|
||||||
if(!(Current = IntGetWindowObject(*phWnd)))
|
|
||||||
{
|
{
|
||||||
continue;
|
if (!(Current = IntGetWindowObject(*phWnd)))
|
||||||
}
|
|
||||||
|
|
||||||
if (Current->Style & WS_VISIBLE &&
|
|
||||||
(!(Current->Style & WS_DISABLED) || (Current->Style & (WS_CHILD | WS_POPUP)) != WS_CHILD) &&
|
|
||||||
IntPtInWindow(Current, Point->x, Point->y))
|
|
||||||
{
|
|
||||||
if(*Window)
|
|
||||||
{
|
|
||||||
IntReleaseWindowObject(*Window);
|
|
||||||
}
|
|
||||||
*Window = Current;
|
|
||||||
|
|
||||||
if(Current->Style & WS_DISABLED)
|
|
||||||
{
|
|
||||||
*HitTest = HTERROR;
|
|
||||||
ExFreePool(List);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(OnlyHitTests && (Current->MessageQueue == OnlyHitTests))
|
|
||||||
{
|
|
||||||
*HitTest = IntSendMessage(Current->Self, WM_NCHITTEST, 0,
|
|
||||||
MAKELONG(Point->x, Point->y));
|
|
||||||
if((*HitTest) == (USHORT)HTTRANSPARENT)
|
|
||||||
{
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
}
|
if (!(Current->Style & WS_VISIBLE))
|
||||||
else
|
continue;
|
||||||
{
|
|
||||||
*HitTest = HTCLIENT;
|
if ((Current->Style & (WS_POPUP | WS_CHILD | WS_DISABLED)) ==
|
||||||
}
|
(WS_CHILD | WS_DISABLED))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!IntPtInWindow(Current, Point->x, Point->y))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (*Window)
|
||||||
|
IntReleaseWindowObject(*Window);
|
||||||
|
*Window = Current;
|
||||||
|
|
||||||
|
if (Current->Style & WS_MINIMIZE)
|
||||||
|
{
|
||||||
|
*HitTest = HTCAPTION;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Current->Style & WS_DISABLED)
|
||||||
|
{
|
||||||
|
*HitTest = HTERROR;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if(Point->x >= Current->ClientRect.left &&
|
if (OnlyHitTests && (Current->MessageQueue == OnlyHitTests))
|
||||||
Point->x < Current->ClientRect.right &&
|
{
|
||||||
Point->y >= Current->ClientRect.top &&
|
*HitTest = IntSendMessage(Current->Self, WM_NCHITTEST, 0,
|
||||||
Point->y < Current->ClientRect.bottom)
|
MAKELONG(Point->x, Point->y));
|
||||||
{
|
if ((*HitTest) == (USHORT)HTTRANSPARENT)
|
||||||
WinPosSearchChildren(Current, OnlyHitTests, Point, Window, HitTest);
|
continue;
|
||||||
ExFreePool(List);
|
}
|
||||||
return;
|
else
|
||||||
}
|
*HitTest = HTCLIENT;
|
||||||
|
|
||||||
ExFreePool(List);
|
if (Point->x >= Current->ClientRect.left &&
|
||||||
return;
|
Point->x < Current->ClientRect.right &&
|
||||||
|
Point->y >= Current->ClientRect.top &&
|
||||||
|
Point->y < Current->ClientRect.bottom)
|
||||||
|
{
|
||||||
|
WinPosSearchChildren(Current, OnlyHitTests, Point, Window, HitTest);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
IntReleaseWindowObject(Current);
|
ExFreePool(List);
|
||||||
}
|
}
|
||||||
ExFreePool(List);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
USHORT FASTCALL
|
USHORT FASTCALL
|
||||||
|
|
Loading…
Reference in a new issue