diff --git a/dlls/user32/win.c b/dlls/user32/win.c index 0a3f65e5aa4..881825b5510 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -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 ); } /*********************************************************************** diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 0b826644131..10c6ff4bf89 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -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: diff --git a/include/ntuser.h b/include/ntuser.h index 46da835e24b..38cc8f96057 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -198,6 +198,7 @@ enum NtUserGetWindowDpiAwarenessContext, NtUserGetWindowTextLength, NtUserIsWindow, + NtUserIsWindowEnabled, NtUserIsWindowUnicode, NtUserIsWindowVisible, };