user32/tests: Move MDI tests out of the WM_CREATE handler.
This helps to avoid side effects of the not yet finished window creation process. Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
e6e7055c0b
commit
2e8166ec0e
|
@ -1869,51 +1869,7 @@ static LRESULT WINAPI mdi_main_wnd_procA(HWND hwnd, UINT msg, WPARAM wparam, LPA
|
||||||
switch (msg)
|
switch (msg)
|
||||||
{
|
{
|
||||||
case WM_CREATE:
|
case WM_CREATE:
|
||||||
{
|
return 1;
|
||||||
CLIENTCREATESTRUCT client_cs;
|
|
||||||
RECT rc;
|
|
||||||
|
|
||||||
GetClientRect(hwnd, &rc);
|
|
||||||
|
|
||||||
client_cs.hWindowMenu = 0;
|
|
||||||
client_cs.idFirstChild = 1;
|
|
||||||
|
|
||||||
/* MDIClient without MDIS_ALLCHILDSTYLES */
|
|
||||||
mdi_client = CreateWindowExA(0, "mdiclient",
|
|
||||||
NULL,
|
|
||||||
WS_CHILD /*| WS_VISIBLE*/,
|
|
||||||
/* tests depend on a not zero MDIClient size */
|
|
||||||
0, 0, rc.right, rc.bottom,
|
|
||||||
hwnd, 0, GetModuleHandleA(NULL),
|
|
||||||
&client_cs);
|
|
||||||
assert(mdi_client);
|
|
||||||
test_MDI_create(hwnd, mdi_client, client_cs.idFirstChild);
|
|
||||||
DestroyWindow(mdi_client);
|
|
||||||
|
|
||||||
/* MDIClient with MDIS_ALLCHILDSTYLES */
|
|
||||||
mdi_client = CreateWindowExA(0, "mdiclient",
|
|
||||||
NULL,
|
|
||||||
WS_CHILD | MDIS_ALLCHILDSTYLES /*| WS_VISIBLE*/,
|
|
||||||
/* tests depend on a not zero MDIClient size */
|
|
||||||
0, 0, rc.right, rc.bottom,
|
|
||||||
hwnd, 0, GetModuleHandleA(NULL),
|
|
||||||
&client_cs);
|
|
||||||
assert(mdi_client);
|
|
||||||
test_MDI_create(hwnd, mdi_client, client_cs.idFirstChild);
|
|
||||||
DestroyWindow(mdi_client);
|
|
||||||
|
|
||||||
/* Test child window stack management */
|
|
||||||
mdi_client = CreateWindowExA(0, "mdiclient",
|
|
||||||
NULL,
|
|
||||||
WS_CHILD,
|
|
||||||
0, 0, rc.right, rc.bottom,
|
|
||||||
hwnd, 0, GetModuleHandleA(NULL),
|
|
||||||
&client_cs);
|
|
||||||
assert(mdi_client);
|
|
||||||
test_MDI_child_stack(mdi_client);
|
|
||||||
DestroyWindow(mdi_client);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case WM_WINDOWPOSCHANGED:
|
case WM_WINDOWPOSCHANGED:
|
||||||
{
|
{
|
||||||
|
@ -1993,7 +1949,9 @@ static BOOL mdi_RegisterWindowClasses(void)
|
||||||
|
|
||||||
static void test_mdi(void)
|
static void test_mdi(void)
|
||||||
{
|
{
|
||||||
HWND mdi_hwndMain;
|
HWND mdi_hwndMain, mdi_client;
|
||||||
|
CLIENTCREATESTRUCT client_cs;
|
||||||
|
RECT rc;
|
||||||
/*MSG msg;*/
|
/*MSG msg;*/
|
||||||
|
|
||||||
if (!mdi_RegisterWindowClasses()) assert(0);
|
if (!mdi_RegisterWindowClasses()) assert(0);
|
||||||
|
@ -2005,6 +1963,46 @@ static void test_mdi(void)
|
||||||
GetDesktopWindow(), 0,
|
GetDesktopWindow(), 0,
|
||||||
GetModuleHandleA(NULL), NULL);
|
GetModuleHandleA(NULL), NULL);
|
||||||
assert(mdi_hwndMain);
|
assert(mdi_hwndMain);
|
||||||
|
|
||||||
|
GetClientRect(mdi_hwndMain, &rc);
|
||||||
|
|
||||||
|
client_cs.hWindowMenu = 0;
|
||||||
|
client_cs.idFirstChild = 1;
|
||||||
|
|
||||||
|
/* MDIClient without MDIS_ALLCHILDSTYLES */
|
||||||
|
mdi_client = CreateWindowExA(0, "mdiclient",
|
||||||
|
NULL,
|
||||||
|
WS_CHILD /*| WS_VISIBLE*/,
|
||||||
|
/* tests depend on a not zero MDIClient size */
|
||||||
|
0, 0, rc.right, rc.bottom,
|
||||||
|
mdi_hwndMain, 0, GetModuleHandleA(NULL),
|
||||||
|
&client_cs);
|
||||||
|
assert(mdi_client);
|
||||||
|
test_MDI_create(mdi_hwndMain, mdi_client, client_cs.idFirstChild);
|
||||||
|
DestroyWindow(mdi_client);
|
||||||
|
|
||||||
|
/* MDIClient with MDIS_ALLCHILDSTYLES */
|
||||||
|
mdi_client = CreateWindowExA(0, "mdiclient",
|
||||||
|
NULL,
|
||||||
|
WS_CHILD | MDIS_ALLCHILDSTYLES /*| WS_VISIBLE*/,
|
||||||
|
/* tests depend on a not zero MDIClient size */
|
||||||
|
0, 0, rc.right, rc.bottom,
|
||||||
|
mdi_hwndMain, 0, GetModuleHandleA(NULL),
|
||||||
|
&client_cs);
|
||||||
|
assert(mdi_client);
|
||||||
|
test_MDI_create(mdi_hwndMain, mdi_client, client_cs.idFirstChild);
|
||||||
|
DestroyWindow(mdi_client);
|
||||||
|
|
||||||
|
/* Test child window stack management */
|
||||||
|
mdi_client = CreateWindowExA(0, "mdiclient",
|
||||||
|
NULL,
|
||||||
|
WS_CHILD,
|
||||||
|
0, 0, rc.right, rc.bottom,
|
||||||
|
mdi_hwndMain, 0, GetModuleHandleA(NULL),
|
||||||
|
&client_cs);
|
||||||
|
assert(mdi_client);
|
||||||
|
test_MDI_child_stack(mdi_client);
|
||||||
|
DestroyWindow(mdi_client);
|
||||||
/*
|
/*
|
||||||
while(GetMessage(&msg, 0, 0, 0))
|
while(GetMessage(&msg, 0, 0, 0))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue