mirror of
https://github.com/reactos/wine.git
synced 2024-11-29 06:30:37 +00:00
user32: Don't hide the window in SetParent when window and parent are equal.
This commit is contained in:
parent
b184b13c5f
commit
8d127f3a81
@ -445,6 +445,12 @@ static void test_parent_owner(void)
|
||||
ret = SetParent( test, child );
|
||||
ok( ret == desktop, "SetParent return value %p expected %p\n", ret, desktop );
|
||||
check_parents( test, child, child, 0, 0, hwndMain, test );
|
||||
|
||||
ShowWindow( test, SW_SHOW );
|
||||
ret = SetParent( test, test );
|
||||
ok( ret == NULL, "SetParent return value %p expected %p\n", ret, NULL );
|
||||
ok( GetWindowLongA( test, GWL_STYLE ) & WS_VISIBLE, "window is not visible after SetParent\n" );
|
||||
check_parents( test, child, child, 0, 0, hwndMain, test );
|
||||
DestroyWindow( test );
|
||||
|
||||
/* owned popup */
|
||||
|
@ -2701,6 +2701,12 @@ HWND WINAPI SetParent( HWND hwnd, HWND parent )
|
||||
if (!(full_handle = WIN_IsCurrentThread( hwnd )))
|
||||
return (HWND)SendMessageW( hwnd, WM_WINE_SETPARENT, (WPARAM)parent, 0 );
|
||||
|
||||
if (full_handle == parent)
|
||||
{
|
||||
SetLastError( ERROR_INVALID_PARAMETER );
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Windows hides the window first, then shows it again
|
||||
* including the WM_SHOWWINDOW messages and all */
|
||||
was_visible = ShowWindow( hwnd, SW_HIDE );
|
||||
|
Loading…
Reference in New Issue
Block a user