mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 17:05:46 +00:00
Optimize IsWindowVisible() a bit more to use the desktop heap directly
svn path=/trunk/; revision=30520
This commit is contained in:
parent
0a9026f76e
commit
53b892f4d2
1 changed files with 27 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue