Commit 256d0c0b authored by Juris Smotrovs's avatar Juris Smotrovs Committed by Alexandre Julliard

user: Test cases demonstrating position changes for MDI children.

parent 53654c69
......@@ -1483,6 +1483,22 @@ static const struct message WmCreateMDIclientSeq[] = {
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
{ 0 }
};
/* ShowWindow(SW_SHOW) for MDI client window */
static const struct message WmShowMDIclientSeq[] = {
{ WM_SHOWWINDOW, sent|wparam, 1 },
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOSIZE|SWP_NOMOVE },
{ EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam, 0, 0 },
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
{ 0 }
};
/* ShowWindow(SW_HIDE) for MDI client window */
static const struct message WmHideMDIclientSeq[] = {
{ WM_SHOWWINDOW, sent|wparam, 0 },
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_HIDEWINDOW|SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOSIZE|SWP_NOMOVE },
{ EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam, 0, 0 },
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_HIDEWINDOW|SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
{ 0 }
};
/* DestroyWindow for MDI client window, initially visible */
static const struct message WmDestroyMDIclientSeq[] = {
{ HCBT_DESTROYWND, hook },
......@@ -1536,6 +1552,40 @@ static const struct message WmCreateMDIchildVisibleSeq[] = {
{ WM_MDIACTIVATE, sent|defwinproc },
{ 0 }
};
/* CreateWindow for MDI child window with invisible parent */
static const struct message WmCreateMDIchildInvisibleParentSeq[] = {
{ HCBT_CREATEWND, hook },
{ WM_GETMINMAXINFO, sent },
{ WM_NCCREATE, sent },
{ WM_NCCALCSIZE, sent|wparam, 0 },
{ WM_CREATE, sent },
{ EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, 0, 0 },
{ WM_SIZE, sent },
{ WM_MOVE, sent },
{ WM_PARENTNOTIFY, sent /*|wparam, WM_CREATE*/ }, /* in MDI client */
{ WM_SHOWWINDOW, sent|wparam, 1 },
{ WM_MDIREFRESHMENU, sent }, /* in MDI client */
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOSIZE|SWP_NOMOVE },
{ WM_CHILDACTIVATE, sent|wparam|lparam, 0, 0 },
{ WM_WINDOWPOSCHANGING, sent|wparam|defwinproc, SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE },
/* Win9x: message sequence terminates here. */
{ WM_NCACTIVATE, sent|wparam|defwinproc, 1 },
{ HCBT_SETFOCUS, hook }, /* in MDI client */
{ WM_IME_SETCONTEXT, sent|wparam|optional, 1 }, /* in MDI client */
{ WM_IME_NOTIFY, sent|wparam|optional, 2 }, /* in MDI client */
{ EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ WM_SETFOCUS, sent }, /* in MDI client */
{ HCBT_SETFOCUS, hook },
{ WM_KILLFOCUS, sent }, /* in MDI client */
{ WM_IME_SETCONTEXT, sent|wparam|optional, 0 }, /* in MDI client */
{ WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 },
{ EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ WM_SETFOCUS, sent|defwinproc },
{ WM_MDIACTIVATE, sent|defwinproc },
{ 0 }
};
/* DestroyWindow for MDI child window, initially visible */
static const struct message WmDestroyMDIchildVisibleSeq[] = {
{ HCBT_DESTROYWND, hook },
......@@ -2139,6 +2189,44 @@ static const struct message WmMaximizeMDIchildInvisibleSeq[] = {
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, /* MDI child */
{ 0 }
};
/* WM_MDIMAXIMIZE for an MDI child window with invisible parent */
static const struct message WmMaximizeMDIchildInvisibleParentSeq[] = {
{ WM_MDIMAXIMIZE, sent }, /* in MDI client */
{ HCBT_MINMAX, hook },
{ WM_GETMINMAXINFO, sent },
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|0x8000 },
{ WM_GETMINMAXINFO, sent|defwinproc },
{ WM_NCCALCSIZE, sent|wparam, 1 },
{ EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam, 0, 0 },
{ WM_CHILDACTIVATE, sent|wparam|lparam, 0, 0 },
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOREDRAW|SWP_NOZORDER|0x8000 },
{ WM_MOVE, sent|defwinproc },
{ WM_SIZE, sent|defwinproc|wparam, SIZE_MAXIMIZED },
{ WM_WINDOWPOSCHANGING, sent|wparam|defwinproc, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
{ WM_NCCALCSIZE, sent|wparam|defwinproc, 1 },
{ WM_WINDOWPOSCHANGED, sent|wparam|defwinproc, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE },
/* in MDI frame */
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
{ WM_NCCALCSIZE, sent|wparam, 1 },
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER },
{ WM_MOVE, sent|defwinproc },
{ WM_SIZE, sent|defwinproc },
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, /* MDI frame */
/* in MDI client */
{ WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOACTIVATE|SWP_NOZORDER },
{ WM_NCCALCSIZE, sent|wparam, 1 },
{ WM_WINDOWPOSCHANGED, sent|wparam, SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW|SWP_NOCLIENTMOVE },
{ WM_SIZE, sent },
/* in MDI child */
{ WM_WINDOWPOSCHANGING, sent|wparam|defwinproc, SWP_NOACTIVATE|SWP_NOZORDER },
{ WM_GETMINMAXINFO, sent|defwinproc },
{ WM_NCCALCSIZE, sent|wparam|defwinproc, 1 },
{ WM_WINDOWPOSCHANGED, sent|wparam|defwinproc, SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOREDRAW|SWP_NOCLIENTMOVE },
{ WM_SIZE, sent|defwinproc|wparam, SIZE_MAXIMIZED },
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, /* MDI child */
{ 0 }
};
/* ShowWindow(SW_MAXIMIZE) for a visible MDI child window */
static const struct message WmMaximizeMDIchildVisibleSeq[] = {
{ HCBT_MINMAX, hook },
......@@ -2756,6 +2844,39 @@ static void test_mdi_messages(void)
DestroyWindow(mdi_client);
ok_sequence(WmDestroyMDIclientSeq, "Destroy MDI client window", FALSE);
/* test maximization of MDI child with invisible parent */
client_cs.hWindowMenu = 0;
mdi_client = CreateWindow("MDI_client_class",
NULL,
WS_CHILD | WS_CLIPCHILDREN | WS_VSCROLL | WS_HSCROLL | WS_VISIBLE,
0, 0, 662, 432,
mdi_frame, 0, GetModuleHandleA(0), &client_cs);
ok_sequence(WmCreateMDIclientSeq, "Create MDI client window", FALSE);
ShowWindow(mdi_client, SW_HIDE);
ok_sequence(WmHideMDIclientSeq, "Hide MDI client window", FALSE);
mdi_child = CreateWindowExA(WS_EX_MDICHILD, "MDI_child_class", "MDI child",
WS_CHILD | WS_CLIPCHILDREN | WS_VSCROLL | WS_HSCROLL,
0, 0, 654, 443,
mdi_client, 0, GetModuleHandleA(0), NULL);
ok_sequence(WmCreateMDIchildInvisibleParentSeq, "Create MDI child window with invisible parent", FALSE);
SendMessage(mdi_client, WM_MDIMAXIMIZE, (WPARAM) mdi_child, 0);
ok_sequence(WmMaximizeMDIchildInvisibleParentSeq, "Maximize MDI child window with invisible parent", TRUE);
zoomed = IsZoomed(mdi_child);
ok(zoomed, "wrong zoomed state %d\n", zoomed);
ShowWindow(mdi_client, SW_SHOW);
ok_sequence(WmShowMDIclientSeq, "Show MDI client window", FALSE);
DestroyWindow(mdi_child);
ok_sequence(WmDestroyMDIchildVisibleSeq, "Destroy visible maximized MDI child window", TRUE);
DestroyWindow(mdi_client);
ok_sequence(WmDestroyMDIclientSeq, "Destroy MDI client window", FALSE);
/* end of test for maximization of MDI child with invisible parent */
DestroyWindow(mdi_frame);
ok_sequence(WmDestroyMDIframeSeq, "Destroy MDI frame window", FALSE);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment