Ignore attempts to hide an already invisible window. Add a test case

for this behaviour, passes on Wine and Windows 2000.
This commit is contained in:
Mike Hearn 2004-06-03 23:26:35 +00:00 committed by Alexandre Julliard
parent a1e8ba9fc2
commit eff34efcf8
2 changed files with 9 additions and 0 deletions

View File

@ -145,6 +145,10 @@ static const struct message WmHideOverlappedSeq[] = {
{ WM_IME_SETCONTEXT, sent|wparam|optional, 0 },
{ 0 }
};
/* ShowWindow(SW_HIDE) for an invisible overlapped window */
static const struct message WmHideInvisibleOverlappedSeq[] = {
{ 0 }
};
/* DestroyWindow for a visible overlapped window */
static const struct message WmDestroyOverlappedSeq[] = {
{ HCBT_DESTROYWND, hook },
@ -756,6 +760,10 @@ static void test_messages(void)
ok (hwnd != 0, "Failed to create overlapped window\n");
ok_sequence(WmCreateOverlappedSeq, "CreateWindow:overlapped");
/* test ShowWindow(SW_HIDE) on a newly created invisible window */
ok( ShowWindow(hwnd, SW_HIDE) == FALSE, "ShowWindow: window was visible\n" );
ok_sequence(WmHideInvisibleOverlappedSeq, "ShowWindow(SW_HIDE):overlapped, invisible");
/* test WM_SETREDRAW on a not visible top level window */
test_WM_SETREDRAW(hwnd);

View File

@ -1283,6 +1283,7 @@ BOOL X11DRV_ShowWindow( HWND hwnd, INT cmd )
switch(cmd)
{
case SW_HIDE:
if (!wasVisible) goto END;
swp |= SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE |
SWP_NOACTIVATE | SWP_NOZORDER;
break;