25#ifndef SPI_GETDESKWALLPAPER
26#define SPI_GETDESKWALLPAPER 0x0073
30#define WM_SYSTIMER 0x0118
33#define LONG_PTR INT_PTR
34#define ULONG_PTR UINT_PTR
44static BOOL (
WINAPI *pUpdateLayeredWindowIndirect)(
HWND,
const UPDATELAYEREDWINDOWINFO*);
52static BOOL (
WINAPI *pFlashWindowEx)( PFLASHWINFO pfwi );
71#define COUNTOF(arr) (sizeof(arr)/sizeof(arr[0]))
75 trace(
"Reserved=%d,%d MaxSize=%d,%d MaxPos=%d,%d MinTrack=%d,%d MaxTrack=%d,%d\n",
88 int min_timeout = 100;
126 ok(
res == ga_parent,
"Wrong result for GA_PARENT %p expected %p\n",
res, ga_parent );
129 ok(
res == gwl_parent,
"Wrong result for GWL_HWNDPARENT %p expected %p\n",
res, gwl_parent );
131 ok(
res == get_parent,
"Wrong result for GetParent %p expected %p\n",
res, get_parent );
133 ok(
res == gw_owner,
"Wrong result for GW_OWNER %p expected %p\n",
res, gw_owner );
137 ok(
res == ga_root,
"Wrong result for GA_ROOT %p expected %p\n",
res, ga_root );
139 ok(
res == ga_root_owner,
"Wrong result for GA_ROOTOWNER %p expected %p\n",
res, ga_root_owner );
143#define check_wnd_state(a,b,c,d) check_wnd_state_(__FILE__,__LINE__,a,b,c,d)
159#define check_active_state(a,b,c) check_active_state_(__FILE__,__LINE__,a,b,c)
188 trace(
"EnumChildProc on %p\n", hwndChild);
196 trace(
"EnumChildProc1 on %p\n", hwndChild);
205 ok(
ret != 0,
"Creation failed\n" );
224 ok( !
test,
"WS_CHILD without parent created\n" );
263 trace(
"created child of desktop %p\n",
test );
281 trace(
"created child of child %p\n",
test );
313 trace(
"created owned top-level %p\n",
test );
341 trace(
"created owned popup %p\n",
test );
355 trace(
"created top-level owned by child %p\n",
test );
365 trace(
"created popup owned by desktop %p\n",
test );
375 trace(
"created popup owned by child %p\n",
test );
385 trace(
"created WS_CHILD popup %p\n",
test );
395 trace(
"created owned WS_CHILD popup %p\n",
test );
404 trace(
"testing parent changes\n" );
412 ok( !
ret,
"Set GWL_HWNDPARENT succeeded on desktop\n" );
437 ok(
ret == 0,
"GWL_HWNDPARENT return value %p expected 0\n",
ret );
441 win_skip(
"Test creates circular window tree under Win9x/WinMe\n" );
444 ok(
ret == 0,
"GWL_HWNDPARENT return value %p expected 0\n",
ret );
457 ok(
ret == 0,
"GWL_HWNDPARENT return value %p expected 0\n",
ret );
474 ok(
ret == 0,
"GWL_HWNDPARENT return value %p expected 0\n",
ret );
495 ok(
ret == desktop,
"SetParent return value %p expected %p\n",
ret, desktop );
508 ok(
ret == desktop,
"SetParent return value %p expected %p\n",
ret, desktop );
520 win_skip(
"Test crashes on Win9x/WinMe\n" );
525 trace(
"created owned popup %p\n",
test );
528 ok(
ret == desktop,
"SetParent return value %p expected %p\n",
ret, desktop );
541 trace(
"created owner %p and popup %p\n", owner,
test );
543 ok(
ret == desktop,
"SetParent return value %p expected %p\n",
ret, desktop );
552 ok( !
IsWindow(owner),
"Owner %p not destroyed\n", owner );
558 trace(
"created owner %p and popup %p\n", owner,
test );
566 trace(
"created owner %p and popup %p\n", owner,
test );
568 ok(
ret == 0,
"GWL_HWNDPARENT return value %p expected 0\n",
ret );
572 ok( !
IsWindow(owner),
"Owner %p not destroyed\n", owner );
589 "EnumChildWindows should have returned FALSE\n" );
590 ok( numChildren == 0,
"numChildren should be 0 got %d\n", numChildren );
594 ok(
ret == desktop,
"SetParent return value %p expected %p\n",
ret, desktop );
598 "EnumChildWindows should have returned TRUE\n" );
599 ok( numChildren == 1,
"numChildren should be 1 got %d\n", numChildren );
604 "EnumChildWindows should have returned FALSE\n" );
605 ok( numChildren == 2,
"numChildren should be 2 got %d\n", numChildren );
612 "EnumChildWindows should have returned TRUE\n" );
613 ok( numChildren == 1,
"numChildren should be 1 got %d\n", numChildren );
617 ok(
ret == desktop,
"SetParent return value %p expected %p\n",
ret, desktop );
620 "EnumChildWindows should have returned FALSE\n" );
621 ok( numChildren == 2,
"numChildren should be 2 got %d\n", numChildren );
625 ok(
ret == owner,
"SetParent return value %p expected %p\n",
ret, owner );
628 "EnumChildWindows should have returned TRUE\n" );
629 ok( numChildren == 1,
"numChildren should be 1 got %d\n", numChildren );
633 "EnumChildWindows should have found %p and returned FALSE\n",
child );
639 "EnumChildWindows should have found %p and returned FALSE\n",
child );
684 if (pGetGUIThreadInfo)
690 "GetGUIThreadInfo failed without message queue\n" );
694 ok( !
ret,
"GetGUIThreadInfo succeeded with wrong size\n" );
704 ok(
ret,
"EnumThreadWindows should have returned TRUE\n" );
708 0, 0, 100, 100, 0, 0, 0,
NULL );
711 ok(
ret,
"EnumThreadWindows should have returned TRUE\n" );
716 0, 0, 100, 100, 0, 0, 0,
NULL );
721 0, 0, 100, 100, 0, 0, 0,
NULL );
724 ok( !
ret,
"EnumThreadWindows should have returned FALSE\n" );
763 ok(winpos->
x >= -32768 && winpos->
x <= 32767,
"bad winpos->x %d\n", winpos->
x);
764 ok(winpos->
y >= -32768 && winpos->
y <= 32767,
"bad winpos->y %d\n", winpos->
y);
769 ok((winpos->
cx >= 0 && winpos->
cx <= 32767) ||
771 "bad winpos->cx %d\n", winpos->
cx);
772 ok((winpos->
cy >= 0 && winpos->
cy <= 32767) ||
774 "bad winpos->cy %d\n", winpos->
cy);
783 ok(winpos->
x >= -32768 && winpos->
x <= 32767,
"bad winpos->x %d\n", winpos->
x);
784 ok(winpos->
y >= -32768 && winpos->
y <= 32767,
"bad winpos->y %d\n", winpos->
y);
786 ok((winpos->
cx >= 0 && winpos->
cx <= 32767) ||
788 "bad winpos->cx %d\n", winpos->
cx);
789 ok((winpos->
cy >= 0 && winpos->
cy <= 32767) ||
791 "bad winpos->cy %d\n", winpos->
cy);
817 ok(got_getminmaxinfo,
"main: WM_GETMINMAXINFO should have been received before WM_NCCREATE\n");
819 ok(!got_getminmaxinfo,
"main: WM_GETMINMAXINFO should NOT have been received before WM_NCCREATE\n");
835 ok(*
text == 0,
"expected empty string buffer %x\n", *
text);
861 ok(*
text == 0,
"expected empty string buffer %x\n", *
text);
885 ok(got_getminmaxinfo,
"tool: WM_GETMINMAXINFO should have been received before WM_NCCREATE\n");
887 ok(!got_getminmaxinfo,
"tool: WM_GETMINMAXINFO should NOT have been received before WM_NCCREATE\n");
895static const WCHAR mainclassW[] = {
'M',
'a',
'i',
'n',
'W',
'i',
'n',
'd',
'o',
'w',
'C',
'l',
'a',
's',
's',
'W',0};
946 RECT rcWindow, rcClient;
960 "wrong dwStyle: %08x != %08x for %p in hook %s\n",
966 "wrong dwExStyle: %08x != %08x for %p in hook %s\n",
970 ok(
info->dwWindowStatus ==
status,
"wrong dwWindowStatus: %04x != %04x active %p fg %p in hook %s\n",
973 ok(1,
"Just counting");
981 ok(
info->cxWindowBorders == (
unsigned)(rcClient.
left - rcWindow.
left),
982 "wrong cxWindowBorders %d != %d\n",
info->cxWindowBorders, rcClient.
left - rcWindow.
left);
985 "wrong cyWindowBorders %d != %d\n",
info->cyWindowBorders,
border);
989 ok(
info->wCreatorVersion == 0x0400 ||
990 info->wCreatorVersion == 0x0500 ,
991 "wrong wCreatorVersion %04x for %p in hook %s\n",
info->wCreatorVersion,
hwnd,
hook);
1058 RECT rc_window, rc_client, rc;
1071 rc_window.
right > 32768 || rc_window.
bottom > 32768)
return;
1078 "window rect does not match: style:exstyle=0x%08x:0x%08x, menu=%d, win=%s, calc=%s\n",
1085 "window rect does not match: style:exstyle=0x%08x:0x%08x, menu=%d, win=%s, calc=%s\n",
1093 "client rect does not match: style:exstyle=0x%08x:0x%08x, menu=%d client=%s, calc=%s\n",
1098 ok(
ret == 0,
"NULL rectangle returned %ld instead of 0\n",
ret);
1105 SetRect(&rc_client, 0, 0, 250, 150);
1106 rc_window = rc_client;
1114 "synthetic rect does not match: style:exstyle=0x%08x:0x%08x, menu=%d, client=%s, calc=%s\n",
1120 static const char *CBT_code_name[10] = {
1127 "HCBT_CLICKSKIPPED",
1131 const char *code_name = (nCode >= 0 && nCode <=
HCBT_SETFOCUS) ? CBT_code_name[nCode] :
"Unknown";
1138 static const RECT rc_null;
1148 ok(pGetWindowInfo(
hwnd, &
info),
"GetWindowInfo should not fail\n");
1155 "style of hwnd and style in the CREATESTRUCT do not match: %08x != %08x\n",
1164 "wrong result from GetParent %p: message window %p\n",
1190 "GA_ROOT is set to %p, expected %p\n", pGetAncestor(
hwnd,
GA_ROOT),
hwnd);
1194 "GA_ROOTOWNER should be set to hwndMessage at this point\n");
1201 ok(
EqualRect(&rc, &rc_null),
"window rect should be set to 0 HCBT_CREATEWND\n");
1203 ok(
EqualRect(&rc, &rc_null),
"client rect should be set to 0 on HCBT_CREATEWND\n");
1219 ok(pGetWindowInfo(
hwnd, &
info),
"GetWindowInfo should not fail\n");
1240 HWND hwnd1, hwnd2, hwnd3, hwnd4, hwnd5;
1241 HWND shellWindow, nextWnd;
1245 win_skip(
"Skipping shell window test on Win9x\n");
1255 trace(
"previous shell window: %p\n", shellWindow);
1265 skip(
"cannot get access to shell process\n" );
1273 ok(!
ret,
"DestroyWindow(shellWindow)\n");
1276 "got %u after DestroyWindow(shellWindow)\n",
error);
1280 ok(
ret,
"termination of previous shell process failed: GetLastError()=%d\n",
GetLastError());
1285 hwnd1 =
CreateWindowExA(0,
"#32770",
"TEST1",
WS_OVERLAPPEDWINDOW, 100, 100, 300, 200, 0, 0,
hinst, 0);
1286 trace(
"created window 1: %p\n", hwnd1);
1289 ok(
ret,
"first call to SetShellWindow(hwnd1)\n");
1291 ok(shellWindow==hwnd1,
"wrong shell window: %p\n", shellWindow);
1294 ok(!
ret,
"second call to SetShellWindow(hwnd1)\n");
1308 ok(!
ret,
"SetWindowExStyle(hwnd1, WS_EX_TOPMOST)\n");
1311 ok(
ret,
"DestroyWindow(hwnd1)\n");
1313 hwnd2 =
CreateWindowExA(
WS_EX_TOPMOST,
"#32770",
"TEST2",
WS_OVERLAPPEDWINDOW, 150, 250, 300, 200, 0, 0,
hinst, 0);
1314 trace(
"created window 2: %p\n", hwnd2);
1316 ok(!
ret,
"SetShellWindow(hwnd2) with WS_EX_TOPMOST\n");
1318 hwnd3 =
CreateWindowExA(0,
"#32770",
"TEST3",
WS_OVERLAPPEDWINDOW, 200, 400, 300, 200, 0, 0,
hinst, 0);
1319 trace(
"created window 3: %p\n", hwnd3);
1321 hwnd4 =
CreateWindowExA(0,
"#32770",
"TEST4",
WS_OVERLAPPEDWINDOW, 250, 500, 300, 200, 0, 0,
hinst, 0);
1322 trace(
"created window 4: %p\n", hwnd4);
1325 ok(nextWnd==hwnd3,
"wrong next window for hwnd4: %p - expected hwnd3\n", nextWnd);
1328 ok(
ret,
"SetShellWindow(hwnd4)\n");
1330 ok(shellWindow==hwnd4,
"wrong shell window: %p - expected hwnd4\n", shellWindow);
1333 ok(nextWnd==0,
"wrong next window for hwnd4: %p - expected 0\n", nextWnd);
1336 ok(
ret,
"SetWindowPos(hwnd4, HWND_TOPMOST)\n");
1339 ok(
ret,
"SetWindowPos(hwnd4, hwnd3\n");
1342 ok(!
ret,
"SetShellWindow(hwnd3)\n");
1344 ok(shellWindow==hwnd4,
"wrong shell window: %p - expected hwnd4\n", shellWindow);
1346 hwnd5 =
CreateWindowExA(0,
"#32770",
"TEST5",
WS_OVERLAPPEDWINDOW, 300, 600, 300, 200, 0, 0,
hinst, 0);
1347 trace(
"created window 5: %p\n", hwnd5);
1349 ok(
ret,
"SetWindowPos(hwnd4, hwnd5)\n");
1354 ok(nextWnd==0,
"wrong next window for hwnd4 after SetWindowPos(): %p - expected 0\n", nextWnd);
1373 static const WCHAR classW[] = {
'M',
'D',
'I',
'_',
'c',
'h',
'i',
'l',
'd',
'_',
'C',
'l',
'a',
's',
's',
'_',
'1',0};
1374 static const WCHAR titleW[] = {
'M',
'D',
'I',
' ',
'c',
'h',
'i',
'l',
'd',0};
1378 ok(frame_menu !=
NULL,
"Frame window didn't have a menu\n");
1380 mdi_cs.
szClass =
"MDI_child_Class_1";
1390 ok(mdi_child != 0,
"MDI child creation failed\n");
1392 ok(
id == first_id,
"wrong child id %ld\n",
id);
1395 ok(
hwnd == exp_hwnd,
"WM_MDIGETACTIVE should return %p, got %p\n", exp_hwnd,
hwnd);
1397 ok(!
IsWindow(mdi_child),
"WM_MDIDESTROY failed\n");
1399 mdi_cs.
style = 0x7fffffff;
1401 ok(mdi_child != 0,
"MDI child creation failed\n");
1403 ok(
id == first_id,
"wrong child id %ld\n",
id);
1405 ok(!
hwnd,
"WM_MDIGETACTIVE should return 0, got %p\n",
hwnd);
1407 ok(!
IsWindow(mdi_child),
"WM_MDIDESTROY failed\n");
1409 mdi_cs.
style = 0xffffffff;
1413 ok(!mdi_child,
"MDI child with WS_POPUP and with MDIS_ALLCHILDSTYLES should fail\n");
1417 ok(mdi_child != 0,
"MDI child creation failed\n");
1419 ok(
id == first_id,
"wrong child id %ld\n",
id);
1421 ok(!
hwnd,
"WM_MDIGETACTIVE should return 0, got %p\n",
hwnd);
1424 ok(!
IsWindow(mdi_child),
"WM_MDIDESTROY failed\n");
1439 ok(mdi_child != 0,
"MDI child creation failed\n");
1444 ok(
id == first_id,
"wrong child id %ld\n",
id);
1447 ok(
hwnd == exp_hwnd,
"WM_MDIGETACTIVE should return %p, got %p\n", exp_hwnd,
hwnd);
1450 ok(!
IsWindow(mdi_child),
"WM_MDIDESTROY failed\n");
1459 ok(mdi_child != 0,
"MDI child creation failed\n");
1461 ok(
id == first_id,
"wrong child id %ld\n",
id);
1464 ok(
hwnd == exp_hwnd,
"WM_MDIGETACTIVE should return %p, got %p\n", exp_hwnd,
hwnd);
1467 ok(!
IsWindow(mdi_child),
"WM_MDIDESTROY failed\n");
1475 ok(mdi_child != 0,
"MDI child creation failed\n");
1477 ok(
id == first_id,
"wrong child id %ld\n",
id);
1479 ok(!
hwnd,
"WM_MDIGETACTIVE should return 0, got %p\n",
hwnd);
1482 ok(!
IsWindow(mdi_child),
"WM_MDIDESTROY failed\n");
1492 ok(!mdi_child,
"MDI child with WS_POPUP and with MDIS_ALLCHILDSTYLES should fail\n");
1496 ok(mdi_child != 0,
"MDI child creation failed\n");
1498 ok(
id == first_id,
"wrong child id %ld\n",
id);
1500 ok(!
hwnd,
"WM_MDIGETACTIVE should return 0, got %p\n",
hwnd);
1503 ok(!
IsWindow(mdi_child),
"WM_MDIDESTROY failed\n");
1519 ok(mdi_child != 0,
"MDI child creation failed\n");
1524 ok(
id == first_id,
"wrong child id %ld\n",
id);
1527 ok(
hwnd == exp_hwnd,
"WM_MDIGETACTIVE should return %p, got %p\n", exp_hwnd,
hwnd);
1530 ok(!
IsWindow(mdi_child),
"WM_MDIDESTROY failed\n");
1539 ok(mdi_child != 0,
"MDI child creation failed\n");
1541 ok(
id == first_id,
"wrong child id %ld\n",
id);
1544 ok(
hwnd == exp_hwnd,
"WM_MDIGETACTIVE should return %p, got %p\n", exp_hwnd,
hwnd);
1547 ok(!
IsWindow(mdi_child),
"WM_MDIDESTROY failed\n");
1555 ok(mdi_child != 0,
"MDI child creation failed\n");
1557 ok(
id == first_id,
"wrong child id %ld\n",
id);
1560 ok(
hwnd == exp_hwnd,
"WM_MDIGETACTIVE should return %p, got %p\n", exp_hwnd,
hwnd);
1566 ok(!
IsWindow(mdi_child),
"WM_MDIDESTROY failed\n");
1574 ok(mdi_child != 0,
"MDI child creation failed\n");
1576 ok(
id == first_id,
"wrong child id %ld\n",
id);
1578 ok(!
hwnd,
"WM_MDIGETACTIVE should return 0, got %p\n",
hwnd);
1581 ok(!
IsWindow(mdi_child),
"WM_MDIDESTROY failed\n");
1591 ok(!mdi_child,
"MDI child with WS_POPUP and with MDIS_ALLCHILDSTYLES should fail\n");
1595 ok(mdi_child != 0,
"MDI child creation failed\n");
1597 ok(
id == first_id,
"wrong child id %ld\n",
id);
1599 ok(!
hwnd,
"WM_MDIGETACTIVE should return 0, got %p\n",
hwnd);
1602 ok(!
IsWindow(mdi_child),
"WM_MDIDESTROY failed\n");
1618 ok(mdi_child != 0,
"MDI child creation failed\n");
1623 ok(
id == first_id,
"wrong child id %ld\n",
id);
1626 ok(
hwnd == exp_hwnd,
"WM_MDIGETACTIVE should return %p, got %p\n", exp_hwnd,
hwnd);
1629 ok(!
IsWindow(mdi_child),
"WM_MDIDESTROY failed\n");
1641 ok(!mdi_child,
"WS_EX_MDICHILD with a not MDIClient parent should fail\n");
1650 ok(mdi_child != 0,
"MDI child creation failed\n");
1652 ok(
id == 0,
"wrong child id %ld\n",
id);
1655 ok(!
hwnd,
"WM_MDIGETACTIVE should return 0, got %p\n",
hwnd);
1664 ok(mdi_child != 0,
"MDI child creation failed\n");
1666 ok(
id == 0,
"wrong child id %ld\n",
id);
1668 ok(!
hwnd,
"WM_MDIGETACTIVE should return 0, got %p\n",
hwnd);
1679 ok(mdi_child != 0,
"MDI child creation failed\n");
1681 ok(
id == 0,
"wrong child id %ld\n",
id);
1683 ok(!
hwnd,
"WM_MDIGETACTIVE should return 0, got %p\n",
hwnd);
1687 trace(
"Creating maximized child with a caption\n");
1694 ok(mdi_child != 0,
"MDI child creation failed\n");
1696 ok(
id == 0,
"wrong child id %ld\n",
id);
1698 ok(!
hwnd,
"WM_MDIGETACTIVE should return 0, got %p\n",
hwnd);
1702 trace(
"Creating maximized child with a caption and a thick frame\n");
1709 ok(mdi_child != 0,
"MDI child creation failed\n");
1711 ok(
id == 0,
"wrong child id %ld\n",
id);
1713 ok(!
hwnd,
"WM_MDIGETACTIVE should return 0, got %p\n",
hwnd);
1720 HWND child_1, child_2, child_3, child_4;
1724 cs.szClass =
"MDI_child_Class_1";
1725 cs.szTitle =
"MDI child";
1735 ok(child_1 != 0,
"expected child_1 to be non NULL\n");
1737 ok(child_2 != 0,
"expected child_2 to be non NULL\n");
1739 ok(child_3 != 0,
"expected child_3 to be non NULL\n");
1741 ok(child_4 != 0,
"expected child_4 to be non NULL\n");
1750 "Unexpected initial order, should be: %p->%p->%p->%p\n",
1751 child_4, child_3, child_2, child_1);
1753 trace(
"Activate child next to %p\n", child_3);
1762 "Broken MDI child stack:\nexpected: %p->%p->%p->%p, but got: %p->%p->%p->%p\n",
1765 trace(
"Activate child previous to %p\n", child_1);
1774 "Broken MDI child stack:\nexpected: %p->%p->%p->%p, but got: %p->%p->%p->%p\n",
1821 ok(!
lstrcmpA(
cs->lpszClass,
"MDI_child_Class_1"),
"wrong class name\n");
1823 ok(!
lstrcmpA(
cs->lpszName,
"MDI child"),
"wrong title\n");
1829 "mdi_cs->style does not match (%08x)\n", mdi_cs->
style);
1843 ok(!(
cs->style &
WS_POPUP),
"WS_POPUP is not allowed\n");
1849 "cs->style does not match (%08x)\n",
cs->style);
1858 "cs->style does not match (%08x)\n",
cs->style);
1878 style &= ~WS_BORDER;
1890 trace(
"DefMDIChildProc returned:\n");
1926 trace(
"%s: x %d, y %d, cx %d, cy %d\n", (
msg ==
WM_NCCREATE) ?
"WM_NCCREATE" :
"WM_CREATE",
1932 ok(!
lstrcmpA(
cs->lpszClass,
"MDI_child_Class_2"),
"wrong class name\n");
1933 ok(!
lstrcmpA(
cs->lpszName,
"MDI child"),
"wrong title\n");
1945 ok(
cs->cy == 0,
"%d != 0\n",
cs->cy);
1964 style &= ~WS_BORDER;
1984 ok(
EqualRect(&rc1, &
rc2),
"rects do not match, window=%s pos=%s\n",
1990 ok(
EqualRect(&rc1, &
rc2),
"rects do not match, window=%s client=%s\n",
1999 trace(
"%s: %p after %p, x %d, y %d, cx %d, cy %d flags %08x\n",
2002 winpos->
x, winpos->
y, winpos->
cx, winpos->
cy, winpos->
flags);
2007 "DefWindowProc should not change WINDOWPOS: %p after %p, x %d, y %d, cx %d, cy %d flags %08x\n",
2009 winpos->
x, winpos->
y, winpos->
cx, winpos->
cy, winpos->
flags);
2052 trace(
"%p after %p, x %d, y %d, cx %d, cy %d flags %08x\n",
2054 winpos->
x, winpos->
y, winpos->
cx, winpos->
cy, winpos->
flags);
2058 trace(
"%p after %p, x %d, y %d, cx %d, cy %d flags %08x\n",
2060 winpos->
x, winpos->
y, winpos->
cx, winpos->
cy, winpos->
flags);
2063 "DefWindowProc should not change WINDOWPOS values\n");
2110 HMENU frame_menu, child_menu;
2114 mdi_hwndMain =
CreateWindowExA(0,
"MDI_parent_Class",
"MDI parent window",
2137 mdi_hwndMain, 0, 0, &client_cs);
2146 ok(mdi_child != 0,
"MDI child creation failed\n");
2149 SetMenu(mdi_hwndMain, frame_menu);
2151 ok(
GetMenuItemCount(frame_menu) == 0,
"Frame menu should be empty after child maximize, but has %u\n",
2157 ok(
GetMenuItemCount(frame_menu) == 0,
"Frame menu should be empty after WM_MDISETMENU, but has %u\n",
2162 ok(
GetMenuItemCount(frame_menu) == 0,
"Frame menu should be empty after child restored, but has %u items\n",
2172 ok(
ret,
"style %#x: GetScrollInfo(SB_HORZ) failed\n",
style[
i]);
2173 ok(si.
nPage == 0,
"expected 0\n");
2174 ok(si.
nPos == 0,
"expected 0\n");
2176 ok(si.
nMin == 0,
"expected 0\n");
2177 ok(si.
nMax == 100,
"expected 100\n");
2180 ok(!
ret,
"style %#x: GetScrollInfo(SB_HORZ) should fail\n",
style[
i]);
2185 ok(
ret,
"style %#x: GetScrollInfo(SB_VERT) failed\n",
style[
i]);
2186 ok(si.
nPage == 0,
"expected 0\n");
2187 ok(si.
nPos == 0,
"expected 0\n");
2189 ok(si.
nMin == 0,
"expected 0\n");
2190 ok(si.
nMax == 100,
"expected 100\n");
2193 ok(!
ret,
"style %#x: GetScrollInfo(SB_VERT) should fail\n",
style[
i]);
2202 ok(
ret,
"style %#x: GetScrollInfo(SB_HORZ) failed\n",
style[
i]);
2203 ok(si.
nPage == 0,
"expected 0\n");
2204 ok(si.
nPos == 0,
"expected 0\n");
2206 ok(si.
nMin == 0,
"expected 0\n");
2207 ok(si.
nMax == 100,
"expected 100\n");
2210 ok(!
ret,
"style %#x: GetScrollInfo(SB_HORZ) should fail\n",
style[
i]);
2215 ok(
ret,
"style %#x: GetScrollInfo(SB_VERT) failed\n",
style[
i]);
2216 ok(si.
nPage == 0,
"expected 0\n");
2217 ok(si.
nPos == 0,
"expected 0\n");
2219 ok(si.
nMin == 0,
"expected 0\n");
2220 ok(si.
nMax == 100,
"expected 100\n");
2223 ok(!
ret,
"style %#x: GetScrollInfo(SB_VERT) should fail\n",
style[
i]);
2234 if (
msg.message == 0x003f)
2236 ok(
msg.hwnd ==
mdi_client,
"message 0x003f should be posted to mdiclient\n");
2240 ok(
msg.hwnd !=
mdi_client,
"message %04x should not be posted to mdiclient\n",
msg.message);
2243 ok(gotit,
"message 0x003f should appear after SetWindowPos\n");
2250 ok(
ret,
"style %#x: GetScrollInfo(SB_HORZ) failed\n",
style[
i]);
2252 ok(si.
nPage != 0,
"expected !0\n");
2253 ok(si.
nPos == 0,
"expected 0\n");
2255 ok(si.
nMin != 0,
"expected !0\n");
2256 ok(si.
nMax != 100,
"expected !100\n");
2259 ok(!
ret,
"style %#x: GetScrollInfo(SB_HORZ) should fail\n",
style[
i]);
2264 ok(
ret,
"style %#x: GetScrollInfo(SB_VERT) failed\n",
style[
i]);
2266 ok(si.
nPage != 0,
"expected !0\n");
2267 ok(si.
nPos == 0,
"expected 0\n");
2269 ok(si.
nMin != 0,
"expected !0\n");
2270 ok(si.
nMax != 100,
"expected !100\n");
2273 ok(!
ret,
"style %#x: GetScrollInfo(SB_VERT) should fail\n",
style[
i]);
2280 SetMenu(mdi_hwndMain, frame_menu);
2285 mdi_hwndMain, 0, 0, &client_cs);
2294 ok(mdi_child != 0,
"MDI child creation failed\n");
2297 ok(
GetMenuItemCount(frame_menu) == 4,
"Frame menu should have 4 items after child maximize, but has %u\n",
2303 ok(
GetMenuItemCount(frame_menu) == 4,
"Frame menu should have 4 items after WM_MDISETMENU, but has %u\n",
2308 ok(
GetMenuItemCount(frame_menu) == 0,
"Frame menu should be empty after child restored, but has %u items\n",
2369 cls.
cbSize =
sizeof(cls);
2389 ok(
res == 0,
"wrong big icon %p/0\n",
res );
2391 ok(
res == 0,
"wrong previous big icon %p/0\n",
res );
2393 ok(
res == icon,
"wrong big icon after set %p/%p\n",
res, icon );
2395 ok(
res == icon,
"wrong previous big icon %p/%p\n",
res, icon );
2397 ok(
res == icon2,
"wrong big icon after set %p/%p\n",
res, icon2 );
2400 ok(
res == 0,
"wrong small icon %p/0\n",
res );
2404 ok(
res == 0,
"wrong previous small icon %p/0\n",
res );
2406 ok(
res == icon,
"wrong small icon after set %p/%p\n",
res, icon );
2408 ok(
res == icon ||
broken(!
res),
"wrong small2 icon after set %p/%p\n",
res, icon );
2410 ok(
res == icon,
"wrong previous small icon %p/%p\n",
res, icon );
2412 ok(
res == small_icon,
"wrong small icon after set %p/%p\n",
res, small_icon );
2414 ok(
res == small_icon ||
broken(!
res),
"wrong small2 icon after set %p/%p\n",
res, small_icon );
2418 ok(
res == icon2,
"wrong big icon after set %p/%p\n",
res, icon2 );
2440 HWND hwnd_grandchild, hwnd_child, hwnd_child2;
2513 ok(!!hwnd_desktop,
"Failed to get hwnd_desktop window (%d).\n",
GetLastError());
2515 ok(!!hwnd_child,
"Failed to create child window (%d)\n",
GetLastError());
2517 ok(!!hwnd_child,
"Failed to create child window (%d)\n",
GetLastError());
2519 ok(!!hwnd_child2,
"Failed to create second child window (%d)\n",
GetLastError());
2569 "(%d,%d)-(%d,%d) != %s\n", rc1.
left+1, rc1.
top+2, rc1.
left+4, rc1.
top+6,
2580 "(%d,%d)-(%d,%d) != %s\n", rc1.
left+1, rc1.
top+2, rc1.
left+4, rc1.
top+6,
2613 ok(!!hwnd_child,
"Failed to create child window (%d)\n",
GetLastError());
2631 ok(
SetMenu(
parent, hMenu),
"SetMenu on a top level window should not fail\n");
2638 ok(
ret == hMenu,
"unexpected menu id %p\n",
ret);
2643 ok(!retok ||
broken(retok) ,
"menu handle should be not valid after DestroyMenu\n");
2647 ok(
ret == hMenu,
"unexpected menu id %p\n",
ret);
2648 ok(
SetMenu(
parent, 0),
"SetMenu(0) on a top level window should not fail\n");
2656 ok(
ret == 0,
"unexpected menu id %p\n",
ret);
2661 ok(
ret == 0,
"unexpected menu id %p\n",
ret);
2663 ok(
SetMenu(
parent, hMenu),
"SetMenu on a top level window should not fail\n");
2670 ok(
ret == hMenu,
"unexpected menu id %p\n",
ret);
2672 ok(
SetMenu(
parent, 0),
"SetMenu(0) on a top level window should not fail\n");
2675 ok(
ret == 0,
"unexpected menu id %p\n",
ret);
2678 child =
CreateWindowExA(0,
"static",
NULL,
WS_CHILD, 0, 0, 0, 0,
parent, (
HMENU)10, 0,
NULL);
2689 ok(!
SetMenu(
child, hMenu),
"SetMenu on a child window should fail\n");
2694 ok(!
SetMenu(
child, 0),
"SetMenu(0) on a child window should fail\n");
2701 ok(
SetMenu(
child, hMenu),
"SetMenu on a popup child window should not fail\n");
2702 ok(
SetMenu(
child, 0),
"SetMenu on a popup child window should not fail\n");
2706 ok(!
SetMenu(
child, hMenu),
"SetMenu on an overlapped child window should fail\n");
2721 ok(!
hwnd,
"have to start without children to perform the test\n");
2738 ok(
child[
i] != 0,
"CreateWindowEx failed to create child window\n");
2742 ok(
hwnd != 0,
"GetWindow(GW_CHILD) failed\n");
2762 const int simple_order[5] = { 0, 1, 2, 3, 4 };
2767 const int complex_order_1[1] = { 0 };
2768 const int complex_order_2[2] = { 1, 0 };
2769 const int complex_order_3[3] = { 1, 0, 2 };
2770 const int complex_order_4[4] = { 1, 0, 2, 3 };
2771 const int complex_order_5[5] = { 4, 1, 0, 2, 3 };
2775 const int complex_order_6[3] = { 0, 1, 2 };
2791#define check_z_order(hwnd, next, prev, owner, topmost) \
2792 check_z_order_debug((hwnd), (next), (prev), (owner), (topmost), \
2830 hwnd, topmost ?
"" :
"NOT ");
2835 HWND hwnd_A, hwnd_B, hwnd_C, hwnd_F;
2837 trace(
"hwnd_D %p, hwnd_E %p\n", hwnd_D, hwnd_E);
2848 trace(
"hwnd_F %p\n", hwnd_F);
2860 trace(
"hwnd_C %p\n", hwnd_C);
2870 trace(
"hwnd_B %p\n", hwnd_B);
2881 trace(
"hwnd_A %p\n", hwnd_A);
2889 trace(
"A %p B %p C %p D %p E %p F %p\n", hwnd_A, hwnd_B, hwnd_C, hwnd_D, hwnd_E, hwnd_F);
2917 trace(
"hwnd_C %p\n", hwnd_C);
2933 RECT win_rect, rgn_rect;
2944 trace(
"win9x, mapping to screen coords\n");
2949 ok( win_rect.
left <= rgn_rect.
left,
"rgn left %d not inside win rect %d\n",
2951 ok( win_rect.
top <= rgn_rect.
top,
"rgn top %d not inside win rect %d\n",
2952 rgn_rect.
top, win_rect.
top );
2953 ok( win_rect.
right >= rgn_rect.
right,
"rgn right %d not inside win rect %d\n",
2955 ok( win_rect.
bottom >= rgn_rect.
bottom,
"rgn bottom %d not inside win rect %d\n",
2965 ok(
child != 0,
"couldn't find child window\n");
2990 child =
CreateWindowExA(0,
"static",
NULL,
WS_CHILD, 0, 0, 0, 0,
hwnd, 0, 0,
NULL);
3002 child2 =
CreateWindowExA(0,
"static",
NULL,
WS_CHILD, 0, 0, 0, 0,
child, 0, 0,
NULL);