diff --git a/dlls/user32/win.c b/dlls/user32/win.c index eecc696023a..fe8d929a102 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -2555,21 +2555,11 @@ LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, UINT size, LONG_PTR newval, B } -/* FIXME: move to win32u */ -static ULONG_PTR get_hwnd_parent( HWND hwnd ) -{ - HWND parent = NtUserGetAncestor( hwnd, GA_PARENT ); - if (parent == GetDesktopWindow()) parent = GetWindow( hwnd, GW_OWNER ); - return (ULONG_PTR)parent; -} - - /********************************************************************** * GetWindowWord (USER32.@) */ WORD WINAPI GetWindowWord( HWND hwnd, INT offset ) { - if (offset == GWLP_HWNDPARENT) return get_hwnd_parent( hwnd ); return NtUserCallHwndParam( hwnd, offset, NtUserGetWindowWord ); } @@ -2590,7 +2580,6 @@ LONG WINAPI GetWindowLongA( HWND hwnd, INT offset ) return 0; #endif default: - if (offset == GWLP_HWNDPARENT) return get_hwnd_parent( hwnd ); return NtUserCallHwndParam( hwnd, offset, NtUserGetWindowLongA ); } } @@ -2612,7 +2601,6 @@ LONG WINAPI GetWindowLongW( HWND hwnd, INT offset ) return 0; #endif default: - if (offset == GWLP_HWNDPARENT) return get_hwnd_parent( hwnd ); return NtUserCallHwndParam( hwnd, offset, NtUserGetWindowLongW ); } } @@ -3805,7 +3793,6 @@ BOOL WINAPI SetProcessDefaultLayout( DWORD layout ) */ LONG_PTR WINAPI GetWindowLongPtrW( HWND hwnd, INT offset ) { - if (offset == GWLP_HWNDPARENT) return get_hwnd_parent( hwnd ); return NtUserCallHwndParam( hwnd, offset, NtUserGetWindowLongPtrW ); } @@ -3814,7 +3801,6 @@ LONG_PTR WINAPI GetWindowLongPtrW( HWND hwnd, INT offset ) */ LONG_PTR WINAPI GetWindowLongPtrA( HWND hwnd, INT offset ) { - if (offset == GWLP_HWNDPARENT) return get_hwnd_parent( hwnd ); return NtUserCallHwndParam( hwnd, offset, NtUserGetWindowLongPtrA ); } diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 3ac177d310a..f7f0d4e6a65 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -612,8 +612,10 @@ static LONG_PTR get_window_long_size( HWND hwnd, INT offset, UINT size, BOOL ans if (offset == GWLP_HWNDPARENT) { - FIXME( "GWLP_HWNDPARENT not supported\n" ); - return 0; + HWND parent = NtUserGetAncestor( hwnd, GA_PARENT ); + if (user_callbacks && parent == user_callbacks->pGetDesktopWindow()) + parent = get_window_relative( hwnd, GW_OWNER ); + return (ULONG_PTR)parent; } if (!(win = get_win_ptr( hwnd )))