win32u: Move IsWindowVisible implementation from user32.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
be1f46bba4
commit
a36fcc827a
|
@ -3016,20 +3016,7 @@ BOOL WINAPI IsChild( HWND parent, HWND child )
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI IsWindowVisible( HWND hwnd )
|
BOOL WINAPI IsWindowVisible( HWND hwnd )
|
||||||
{
|
{
|
||||||
HWND *list;
|
return NtUserCallHwnd( hwnd, NtUserIsWindowVisible );
|
||||||
BOOL retval = TRUE;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
if (!(GetWindowLongW( hwnd, GWL_STYLE ) & WS_VISIBLE)) return FALSE;
|
|
||||||
if (!(list = list_window_parents( hwnd ))) return TRUE;
|
|
||||||
if (list[0])
|
|
||||||
{
|
|
||||||
for (i = 0; list[i+1]; i++)
|
|
||||||
if (!(GetWindowLongW( list[i], GWL_STYLE ) & WS_VISIBLE)) break;
|
|
||||||
retval = !list[i+1] && (list[i] == GetDesktopWindow()); /* top message window isn't visible */
|
|
||||||
}
|
|
||||||
HeapFree( GetProcessHeap(), 0, list );
|
|
||||||
return retval;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -606,6 +606,25 @@ BOOL is_child( HWND parent, HWND child )
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* see IsWindowVisible */
|
||||||
|
static BOOL is_window_visible( HWND hwnd )
|
||||||
|
{
|
||||||
|
HWND *list;
|
||||||
|
BOOL retval = TRUE;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (!(get_window_long( hwnd, GWL_STYLE ) & WS_VISIBLE)) return FALSE;
|
||||||
|
if (!(list = list_window_parents( hwnd ))) return TRUE;
|
||||||
|
if (list[0])
|
||||||
|
{
|
||||||
|
for (i = 0; list[i+1]; i++)
|
||||||
|
if (!(get_window_long( list[i], GWL_STYLE ) & WS_VISIBLE)) break;
|
||||||
|
retval = !list[i+1] && (list[i] == user_callbacks->pGetDesktopWindow()); /* top message window isn't visible */
|
||||||
|
}
|
||||||
|
free( list );
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
static LONG_PTR get_win_data( const void *ptr, UINT size )
|
static LONG_PTR get_win_data( const void *ptr, UINT size )
|
||||||
{
|
{
|
||||||
if (size == sizeof(WORD))
|
if (size == sizeof(WORD))
|
||||||
|
@ -955,6 +974,8 @@ DWORD WINAPI NtUserCallHwnd( HWND hwnd, DWORD code )
|
||||||
return get_server_window_text( hwnd, NULL, 0 );
|
return get_server_window_text( hwnd, NULL, 0 );
|
||||||
case NtUserIsWindow:
|
case NtUserIsWindow:
|
||||||
return is_window( hwnd );
|
return is_window( hwnd );
|
||||||
|
case NtUserIsWindowVisible:
|
||||||
|
return is_window_visible( hwnd );
|
||||||
default:
|
default:
|
||||||
FIXME( "invalid code %u\n", code );
|
FIXME( "invalid code %u\n", code );
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -142,6 +142,7 @@ enum
|
||||||
NtUserGetParent,
|
NtUserGetParent,
|
||||||
NtUserGetWindowTextLength,
|
NtUserGetWindowTextLength,
|
||||||
NtUserIsWindow,
|
NtUserIsWindow,
|
||||||
|
NtUserIsWindowVisible,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* NtUserCallHwndParam codes, not compatible with Windows */
|
/* NtUserCallHwndParam codes, not compatible with Windows */
|
||||||
|
|
Loading…
Reference in New Issue