48#define NUM_MSG_SEQUENCES 3
49#define TREEVIEW_SEQ_INDEX 0
50#define PARENT_SEQ_INDEX 1
51#define PARENT_CD_SEQ_INDEX 2
53#define expect(expected, got) ok(got == expected, "Expected %d, got %d\n", expected, got)
62 int min_timeout = 100;
418 static LONG defwndproc_counter = 0;
430 defwndproc_counter++;
432 defwndproc_counter--;
464 U(ins).item.pszText =
root;
470 U(ins).item.pszText =
child;
511 static const CHAR test2A[] =
"TEST2";
541 ok(hItem1 !=
NULL,
"failed to set Item1\n");
559 U(ins).item.pszText =
NULL;
561 ok(hItem2 !=
NULL,
"failed to set Item2\n");
596 "no TVN_GETDISPINFO for a state seq",
FALSE);
617 "callback for state/overlay image index, noop seq",
FALSE);
634 "callback for state/overlay image index seq",
FALSE);
668 ok(!
strcmp(
sequence,
"1(nR)nR23(Rn)Rn45(nR)nR."),
"root-none select test\n");
670 "root-none select seq",
FALSE);
694 ok(!
strcmp(
sequence,
"1(nR)nR23(RC)RC45(CR)CR."),
"root-child select test\n");
696 "root-child select seq",
FALSE);
708 CHAR szBuffer[80] =
"Blah";
719 U(ins).item.mask = 0;
720 U(ins).item.pszText =
NULL;
721 U(ins).item.cchTextMax = 0;
732 ok(!
strcmp(szBuffer,
""),
"szBuffer=\"%s\", expected \"\"\n", szBuffer);
742 static CHAR child1[] =
"Edit",
743 child2[] =
"A really long string";
761 U(ins).item.pszText = child1;
763 ok(hChild1 !=
NULL,
"failed to set hChild1\n");
766 U(ins).item.pszText = child2;
768 ok(hChild2 !=
NULL,
"failed to set hChild2\n");
792 ok(crColor == ~0
u,
"Default background color reported as 0x%.8x\n", crColor);
797 ok(crColor ==
RGB(0,0,0),
"Black background color reported as 0x%.8x\n", crColor);
802 ok(crColor ==
RGB(255,255,255),
"White background color reported as 0x%.8x\n", crColor);
808 "test get set bkcolor",
FALSE);
826 ok(
himl ==
NULL,
"NULL image list, reported as %p, expected 0.\n",
himl);
831 "test get imagelist",
FALSE);
840 int ulMoreThanTwiceMin;
853 ulMoreThanTwiceMin = 2*ulMinIndent+1;
856 ok(ulIndent == ulMoreThanTwiceMin,
"Indent reported as %d, expected %d\n", ulIndent, ulMoreThanTwiceMin);
859 "test get set indent",
FALSE);
876 ok(crColor ==
RGB(0,0,0),
"Insert mark color reported as 0x%.8x, expected 0x00000000\n", crColor);
879 "test get set insertmark color",
FALSE);
887 int nBufferSize = 80;
888 char szBuffer[80] = {0};
913 ok(!
strcmp(
"Root", szBuffer),
"GetItem: szBuffer=\"%s\", expected \"Root\"\n", szBuffer);
917 lstrcpynA(szBuffer,
"Testing123", nBufferSize);
920 memset(szBuffer, 0, nBufferSize);
923 ok(!
strcmp(
"Testing123", szBuffer),
"GetItem: szBuffer=\"%s\", expected \"Testing123\"\n", szBuffer);
926 memset(szBuffer, 0, nBufferSize);
927 lstrcpynA(szBuffer,
"Root", nBufferSize);
932 "test get set item",
FALSE);
972 ok(ulNewHeight == ulOldHeight,
"Default height not set properly, reported %d, expected %d\n", ulNewHeight, ulOldHeight);
977 ok(ulNewHeight == 2*ulOldHeight,
"New height not set properly, reported %d, expected %d\n", ulNewHeight, 2*ulOldHeight);
982 ok(ulNewHeight == 8,
"Uneven height not set properly, reported %d, expected %d\n", ulNewHeight, 8);
985 "test get set item height",
FALSE);
991 ok(ulOldHeight == 8,
"got %d, expected %d\n", ulOldHeight, 8);
993 ok(ulNewHeight == 2,
"got %d, expected %d\n", ulNewHeight, 2);
996 ok(ulOldHeight == 2,
"got %d, expected %d\n", ulOldHeight, 2);
998 ok(ulNewHeight == 4,
"got %d, expected %d\n", ulNewHeight, 4);
1004 ok(ulOldHeight == 4,
"got %d, expected %d\n", ulOldHeight, 4);
1006 ok(ulNewHeight == 3,
"got %d, expected %d\n", ulNewHeight, 3);
1009 ok(ulOldHeight == 3,
"got %d, expected %d\n", ulOldHeight, 3);
1011 ok(ulNewHeight == 10,
"got %d, expected %d\n", ulNewHeight, 10);
1018 int ulExpectedTime = 20;
1029 ok(ulTime == ulExpectedTime,
"Scroll time reported as %d, expected %d\n", ulTime, ulExpectedTime);
1032 "test get set scroll time",
FALSE);
1049 ok(crColor == ~0
u,
"Default text color reported as 0x%.8x\n", crColor);
1054 ok(crColor ==
RGB(0,0,0),
"Black text color reported as 0x%.8x\n", crColor);
1059 ok(crColor ==
RGB(255,255,255),
"White text color reported as 0x%.8x\n", crColor);
1065 "test get set text color",
FALSE);
1080 ok(tooltips ==
NULL,
"Unexpected tooltip window %p.\n", tooltips);
1083 ok(tooltips ==
NULL,
"Unexpected ret value %p.\n", tooltips);
1090 ok(
IsWindow(tooltips),
"Unexpected tooltip window %p.\n", tooltips);
1096 ok(tooltips ==
NULL,
"Unexpected tooltip window %p.\n", tooltips);
1103 hwnd =
CreateWindowA(
WC_STATICA,
"Test",
WS_VISIBLE|
WS_CHILD, 5, 5, 100, 100,
hMainWnd,
NULL,
NULL, 0);
1104 ok(
hwnd !=
NULL,
"Failed to create child window.\n");
1107 ok(tooltips ==
NULL,
"Unexpected ret value %p.\n", tooltips);
1110 ok(tooltips ==
hwnd,
"Unexpected tooltip window %p.\n", tooltips);
1117 ok(
IsWindow(tooltips) && tooltips !=
hwnd,
"Unexpected tooltip window %p.\n", tooltips);
1122 ok(!
IsWindow(tooltips),
"Unexpected tooltip window %p.\n", tooltips);
1125 ok(tooltips ==
NULL,
"Unexpected tooltip window %p.\n", tooltips);
1135 ok(
IsWindow(tooltips),
"Unexpected ret value %p.\n", tooltips);
1139 ok(!
IsWindow(
hwnd),
"Unexpected tooltip window %p.\n", tooltips);
1140 ok(
IsWindow(tooltips),
"Expected valid window %p.\n", tooltips);
1143 ok(
IsWindow(tooltips),
"Expected valid window %p.\n", tooltips);
1147 for (
i = 0;
i < 2;
i++)
1151 hwnd =
CreateWindowA(
WC_STATICA,
"Test",
WS_VISIBLE|
WS_CHILD, 5, 5, 100, 100,
hMainWnd,
NULL,
NULL, 0);
1152 ok(
hwnd !=
NULL,
"Failed to create child window.\n");
1161 ok(tooltips ==
hwnd,
"Unexpected tooltip window %p.\n", tooltips);
1180 ok(
IsWindow(tooltips),
"Unexpected ret value %p.\n", tooltips);
1186 "test get set tooltips",
TRUE);
1189 ok(
IsWindow(tooltips),
"Expected valid window.\n");
1195 BOOL bPreviousSetting;
1204 ok(bPreviousSetting ==
FALSE,
"Format should be ANSI.\n");
1211 ok(bNewSetting ==
TRUE,
"Unicode setting did not work.\n");
1216 ok(bNewSetting ==
FALSE,
"ANSI setting did not work.\n");
1222 "test get set unicode format",
FALSE);
1229 static LONG defwndproc_counter = 0;
1257 case WM_NOTIFYFORMAT:
1291 static const WCHAR testW[] = {
'T',
'E',
'S',
'T',
'2',0};
1312 static const char*
textA =
"<edittextaltered>";
1316 ok(
IsWindow(edit),
"failed to get edit handle\n");
1360 ok(pTreeView->
itemNew.
hItem == visibleItem,
"expanded item == first visible item\n");
1363 "Failed to get rect for first visible item.\n");
1367 ok(visibleItem !=
NULL,
"There must be a visible item after the first one.\n");
1369 "Failed to get rect for second visible item.\n");
1390 COLORREF c0ffee =
RGB(0xc0,0xff,0xee), cafe =
RGB(0xca,0xfe,0x00);
1405 "got %08x vs %08x\n", bkgnd, nmcd->
clrTextBk);
1418 ok(bkgnd != c0ffee,
"got 0%x\n", bkgnd);
1442 defwndproc_counter++;
1444 defwndproc_counter--;
1451 static CHAR nodeText[][5] = {
"0",
"1",
"2",
"3",
"4"};
1476 U(ins).item.pszText = nodeText[0];
1478 ok(
node[0] !=
NULL,
"failed to set node[0]\n");
1484 U(ins).item.pszText = nodeText[1];
1486 ok(
node[1] !=
NULL,
"failed to set node[1]\n");
1487 U(ins).item.pszText = nodeText[4];
1489 ok(
node[4] !=
NULL,
"failed to set node[4]\n");
1493 U(ins).item.pszText = nodeText[2];
1495 ok(
node[2] !=
NULL,
"failed to set node[2]\n");
1496 U(ins).item.pszText = nodeText[3];
1498 ok(
node[3] !=
NULL,
"failed to set node[3]\n");
1502 ok(!nodeVisible,
"Node 1 should not be visible.\n");
1505 ok(!nodeVisible,
"Node 2 should not be visible.\n");
1508 ok(!nodeVisible,
"Node 3 should not be visible.\n");
1511 ok(!nodeVisible,
"Node 4 should not be visible.\n");
1517 ok(!nodeVisible,
"Node 1 should not be visible.\n");
1520 ok(!nodeVisible,
"Node 2 should not be visible.\n");
1523 ok(!nodeVisible,
"Node 3 should not be visible.\n");
1526 ok(!nodeVisible,
"Node 4 should not be visible.\n");
1544 U(ins).item.mask = 0;
1546 ok(
first !=
NULL,
"failed to insert first node\n");
1548 ok(second !=
NULL,
"failed to insert second node\n");
1549 for (
i=0;
i<100;
i++)
1552 ok(
last !=
NULL,
"failed to insert %d node\n",
i);
1557 ok(
child !=
NULL,
"failed to insert child node\n");
1565 ok(visible,
"first node should be visible\n");
1566 ok(!
rect.left,
"rect.left = %d\n",
rect.left);
1568 ok(
rect.right,
"rect.right = 0\n");
1569 ok(
rect.bottom,
"rect.bottom = 0\n");
1587 ok(!
IsWindow(edit),
"Expected valid handle\n");
1591 ok(
IsWindow(edit),
"Expected valid handle\n");
1598 ok(
IsWindow(edit),
"Expected edit control to be valid\n");
1601 ok(!
IsWindow(edit),
"Expected edit control to be destroyed\n");
1608 ok(
IsWindow(edit),
"Expected valid handle\n");
1611 ok(
IsWindow(edit),
"Expected edit control to be valid\n");
1619 ok(
IsWindow(edit),
"Expected valid handle\n");
1628 ok(!
IsWindow(edit),
"Expected edit control to be destroyed\n");
1632 item.pszText = buffA;
1636 ok(!
strcmp(
"x", buffA),
"Expected item text to change\n");
1640 ok(
IsWindow(edit),
"Expected valid handle\n");
1644 ok(!
IsWindow(edit),
"expected invalid handle\n");
1647 ok(
IsWindow(edit),
"Expected valid handle\n");
1657 item.pszText = buffA;
1658 item.cchTextMax = 0;
1664 ok(
IsWindow(edit),
"Expected valid handle\n");
1668 ok(!
strcmp(buffA,
"<edittextaltered>"),
"got string %s\n", buffA);
1677 memset(&cls, 0,
sizeof(cls));
1694 win_skip(
"TVM_GETLINECOLOR is not supported on comctl32 < 5.80\n");
1711 win_skip(
"TVM_GETINSERTMARKCOLOR is not supported on comctl32 < 5.80\n");
1873 ok(hitem !=
NULL,
"got %p\n", hitem);
1877 item.cChildren = 0x80000000;
1900 item.iExpandedImage = 1;
1906 item.iExpandedImage = -1;
1911 if (
item.iExpandedImage != 1)
1913 win_skip(
"TVIF_EXPANDEDIMAGE not supported\n");
1920 item.iExpandedImage = -1;
1932 HTREEITEM alpha, bravo, charlie, delta, echo, foxtrot, golf, hotel, india, juliet;
1962 { &charlie, &bravo, 0 },
1964 { &echo, &delta, 0 },
1967 { &hotel, &golf, 0 },
1969 { &juliet, &foxtrot, 0 }
1999 U(ins).item.pszText =
foo;
2015 ok(
ret ==
items[
i].final_state,
"singleexpand items[%d]: expected state 0x%x got 0x%x\n",
2040 ok(clr == ~0
u,
"got %d, expected -1\n", clr);
2048 ok(clr ==
RGB(0, 0, 0),
"got 0x%x\n", clr);
2104 U(ins).item.pszText =
item1;
2106 ok(hItem1 !=
NULL,
"InsertItem failed\n");
2111 U(ins).item.pszText =
item2;
2113 ok(hItem2 !=
NULL,
"InsertItem failed\n");
2211 "Unexpected parent item %p, got %p, %p\n",
parent,
data->parent,
hwnd);
2229 "Width %d, rect width %d.\n",
width,
rect.right -
rect.left);
2233#define CHECK_ITEM(a, b) _check_item(a, b, is_version_6, __LINE__)
2250 U(ins).item.mask = 0;
2257 U(ins).item.mask = 0;
2290 ok(
item.state == 0,
"got 0x%x\n",
item.state);
2306 ok(himl2 !=
NULL,
"got %p\n", himl2);
2307 ok(himl2 ==
himl,
"got %p, expected %p\n", himl2,
himl);
2340 ok(himl2 !=
NULL,
"got %p\n", himl2);
2341 ok(
himl != himl2,
"got %p, expected %p\n", himl2,
himl);
2414 ok(himl2 ==
himl,
"got %p\n", himl2);
2417 ok(himl2 ==
NULL,
"got %p\n", himl2);
2572 static const char *rootA =
"root";
2582 U(ins).item.pszText = (
char*)rootA;
2647 static const char *itemnames[] =
2649 "root",
"Wasp",
"Caribou",
"Vacuum",
2650 "Ocelot",
"Newspaper",
"Litter bin"
2663 U(ins).item.pszText = (
char *)itemnames[
i++];
2669 U(ins).item.pszText = (
char *)itemnames[
i++];
2672 U(ins).item.pszText = (
char *)itemnames[
i++];
2676 U(ins).item.pszText = (
char *)itemnames[
i++];
2679 U(ins).item.pszText = (
char *)itemnames[
i++];
2683 U(ins).item.pszText = (
char *)itemnames[
i++];
2686 U(ins).item.pszText = (
char *)itemnames[
i++];
2692 static const char *initial_order =
"rootWaspVacuumOcelotCaribouNewspaperLitter bin";
2693 static const char *sorted_order =
"rootCaribouNewspaperLitter binWaspVacuumOcelot";
2704 ok(!
ret,
"Unexpected ret value %d\n",
ret);
2707 ok(!
ret,
"Unexpected ret value %d\n",
ret);
2713 U(ins).item.pszText = (
char *)
"root";
2718 ok(!
ret,
"Unexpected ret value %d\n",
ret);
2721 ok(!
ret,
"Unexpected ret value %d\n",
ret);
2726 ok(!
strcmp(
buff, initial_order),
"Wrong initial order %s, expected %s\n",
buff, initial_order);
2732 ok(
ret,
"Unexpected ret value %d\n",
ret);
2734 ok(!
strcmp(
buff, initial_order),
"Wrong sorted order %s, expected %s\n",
buff, initial_order);
2740 ok(
ret,
"Unexpected ret value %d\n",
ret);
2742 ok(!
strcmp(
buff, initial_order),
"Wrong sorted order %s, expected %s\n",
buff, initial_order);
2747 ok(
root !=
NULL,
"Failed to get root item\n");
2749 ok(
ret,
"Unexpected ret value %d\n",
ret);
2751 ok(!
strcmp(
buff, sorted_order),
"Wrong sorted order %s, expected %s\n",
buff, sorted_order);
2757 ok(
ret,
"Unexpected ret value %d\n",
ret);
2759 ok(!
strcmp(
buff, initial_order),
"Wrong sorted order %s, expected %s\n",
buff, sorted_order);
2765 ok(
ret,
"Unexpected ret value %d\n",
ret);
2767 ok(!
strcmp(
buff, initial_order),
"Wrong sorted order %s, expected %s\n",
buff, sorted_order);
2772 ok(
root !=
NULL,
"Failed to get root item\n");
2774 ok(
ret,
"Unexpected ret value %d\n",
ret);
2776 ok(!
strcmp(
buff, sorted_order),
"Wrong sorted order %s, expected %s\n",
buff, sorted_order);
2784 U(ins).item.pszText = (
char *)
"root";
2790 U(ins).item.pszText = (
char *)
"I1";
2795 U(ins).item.pszText = (
char *)
"i1";
2799 ok(
ret,
"Unexpected ret value %d\n",
ret);
2824 ok(
result,
"TVM_GETITEMRECT failed\n");
2856#define X(f) p##f = (void*)GetProcAddress(hComCtl32, #f);
2870 iccex.
dwSize =
sizeof(iccex);
2872 pInitCommonControlsEx(&iccex);
2892 ok(
hMainWnd !=
NULL,
"Failed to create parent window. Tests aborted.\n");