Optimize IsWindowVisible() a bit more to use the desktop heap directly

svn path=/trunk/; revision=30520
This commit is contained in:
Thomas Bluemel 2007-11-17 07:01:14 +00:00
parent 0a9026f76e
commit 53b892f4d2

View file

@ -1342,17 +1342,38 @@ IsWindowUnicode(HWND hWnd)
BOOL STDCALL
IsWindowVisible(HWND hWnd)
{
DWORD Style;
BOOL Ret = FALSE;
PWINDOW Wnd = ValidateHwnd(hWnd);
while ((Style = GetWindowLongW(hWnd, GWL_STYLE)) & WS_CHILD)
if (Wnd != NULL)
{
if (!(Style & WS_VISIBLE))
return FALSE;
_SEH_TRY
{
Ret = TRUE;
hWnd = GetAncestor(hWnd, GA_PARENT);
do
{
if (!(Wnd->Style & WS_VISIBLE))
{
Ret = FALSE;
break;
}
if (Wnd->Parent != NULL)
Wnd = DesktopPtrToUser(Wnd->Parent);
else
break;
} while (Wnd != NULL);
}
_SEH_HANDLE
{
Ret = FALSE;
}
_SEH_END;
}
return (GetWindowLongW(hWnd, GWL_STYLE) & WS_VISIBLE) != 0;
return Ret;
}