win32u: Move IsWindowEnabled 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:
Jacek Caban 2022-04-07 15:26:25 +02:00 committed by Alexandre Julliard
parent d32d3b4f31
commit c31954dfa7
3 changed files with 16 additions and 7 deletions

View File

@ -915,14 +915,9 @@ BOOL WINAPI EnableWindow( HWND hwnd, BOOL enable )
/***********************************************************************
* IsWindowEnabled (USER32.@)
*/
BOOL WINAPI IsWindowEnabled(HWND hWnd)
BOOL WINAPI IsWindowEnabled( HWND hwnd )
{
LONG ret;
SetLastError(NO_ERROR);
ret = GetWindowLongW( hWnd, GWL_STYLE );
if (!ret && GetLastError() != NO_ERROR) return FALSE;
return !(ret & WS_DISABLED);
return NtUserCallHwnd( hwnd, NtUserIsWindowEnabled );
}
/***********************************************************************

View File

@ -807,6 +807,17 @@ BOOL is_window_unicode( HWND hwnd )
return ret;
}
/* see IsWindowEnabled */
static BOOL is_window_enabled( HWND hwnd )
{
LONG ret;
SetLastError( NO_ERROR );
ret = get_window_long( hwnd, GWL_STYLE );
if (!ret && GetLastError() != NO_ERROR) return FALSE;
return !(ret & WS_DISABLED);
}
/* see GetWindowDpiAwarenessContext */
DPI_AWARENESS_CONTEXT get_window_dpi_awareness_context( HWND hwnd )
{
@ -4979,6 +4990,8 @@ ULONG_PTR WINAPI NtUserCallHwnd( HWND hwnd, DWORD code )
return get_server_window_text( hwnd, NULL, 0 );
case NtUserIsWindow:
return is_window( hwnd );
case NtUserIsWindowEnabled:
return is_window_enabled( hwnd );
case NtUserIsWindowUnicode:
return is_window_unicode( hwnd );
case NtUserIsWindowVisible:

View File

@ -198,6 +198,7 @@ enum
NtUserGetWindowDpiAwarenessContext,
NtUserGetWindowTextLength,
NtUserIsWindow,
NtUserIsWindowEnabled,
NtUserIsWindowUnicode,
NtUserIsWindowVisible,
};