49#define expect(expected, got) ok(got == expected, "Expected %d, got %d\n", expected, got)
50#define expect2(expected1, expected2, got1, got2) ok(expected1 == got1 && expected2 == got2, \
51 "expected (%d,%d), got (%d,%d)\n", expected1, expected2, got1, got2)
54 {
'L',
'i',
's',
't',
'v',
'i',
'e',
'w',
' ',
't',
'e',
's',
't',
' ',
'p',
'a',
'r',
'e',
'n',
't',
'W', 0};
87#define X(f) p##f = (void*)GetProcAddress(hComCtl32, #f);
98 { WM_NOTIFYFORMAT,
sent },
190 { WM_STYLECHANGING,
sent },
191 { WM_STYLECHANGED,
sent },
471 static LONG defwndproc_counter = 0;
516 "text limit %d, expected 259\n",
len);
531 ok(
IsWindow(edit),
"expected valid edit control handle\n");
558 static const WCHAR testW[] = {
'T',
'E',
'S',
'T',0};
587 case WM_NOTIFYFORMAT:
595 defwndproc_counter++;
600 defwndproc_counter--;
642 static const WCHAR nameW[] = {
't',
'e',
's',
't',
'p',
'a',
'r',
'e',
'n',
't',
'n',
'a',
'm',
'e',
'W',0};
659 "Listview test parent window",
671 static LONG defwndproc_counter = 0;
684 defwndproc_counter++;
686 defwndproc_counter--;
754 static LONG defwndproc_counter = 0;
766 defwndproc_counter++;
768 defwndproc_counter--;
788 static LONG defwndproc_counter = 0;
808 defwndproc_counter++;
810 defwndproc_counter--;
844 ok_(__FILE__,
line)(lpht.
iSubItem == 10,
"Expected subitem not overwrited\n");
852 else if (broken_flags)
854 "Expected flags %x, got %x\n",
flags, lpht.
flags);
859#define test_lvm_hittest(a,b,c,d,e,f,g,h) test_lvm_hittest_(a,b,c,d,e,f,g,h,__LINE__)
886#define test_lvm_subitemhittest(a,b,c,d,e,f,g,h,i) test_lvm_subitemhittest_(a,b,c,d,e,f,g,h,i,__LINE__)
898 himl = pImageList_Create(40, 40, 0, 4, 4);
899 ok(
himl !=
NULL,
"failed to create imagelist\n");
902 ok(
hbmp !=
NULL,
"failed to create bitmap\n");
905 ok(
r == 0,
"should be zero\n");
909 ok(
hwnd !=
NULL,
"failed to create listview window\n");
914 ok(
r == 0,
"should return zero\n");
917 ok(
r == 0,
"should return zero\n");
920 ok(
r != 0,
"got 0\n");
925 ok(
r == 0,
"should be zero items\n");
933 ok(
r == -1,
"should fail\n");
938 ok(
r == 0,
"should not fail\n");
945 ok(
r ==
TRUE,
"should not fail\n");
950 ok(
r == 0,
"should not fail\n");
972 ok(
hwnd !=
NULL,
"failed to create listview window\n");
976 item.stateMask = 0xffff;
986 item.stateMask = 0xffff;
989 ok(
item.state == 0xfccc,
"state %x\n",
item.state);
993 item.stateMask = 0xffff;
1003 item.stateMask = 0xffff;
1006 ok(
item.state == 0,
"state %x\n",
item.state);
1014 item.stateMask = 0xffff;
1017 if (
item.state != 0x1ccc)
1019 win_skip(
"LVS_EX_CHECKBOXES style is unavailable. Skipping.\n");
1028 item.pszText = text2;
1034 item.stateMask = 0xffff;
1037 ok(
item.state == 0x1000,
"state %x\n",
item.state);
1042 item.stateMask = 0xffff;
1043 item.state = 0x2aaa;
1044 item.pszText = text3;
1050 item.stateMask = 0xffff;
1053 ok(
item.state == 0x1aaa,
"state %x\n",
item.state);
1058 item.stateMask = 0xf000;
1059 item.state = 0x2000;
1065 item.stateMask = 0xffff;
1068 ok(
item.state == 0x2aaa,
"state %x\n",
item.state);
1075 item.stateMask = 0xf000;
1076 item.state = 0xffff;
1079 ok(
item.state == 0x2000,
"state %x\n",
item.state);
1087 item.stateMask = 0xffff;
1090 ok(
item.state == 0x2aaa,
"state %x\n",
item.state);
1098 item.stateMask = 0xffff;
1101 ok(
item.state == 0x2aaa,
"state %x\n",
item.state);
1109 item.stateMask = 0xffff;
1112 ok(
item.state == 0x1aaa,
"state %x\n",
item.state);
1126 item.stateMask = 0xffff;
1129 ok(
item.state == 0x1aab,
"state %x\n",
item.state);
1138 item.stateMask = 0xffff;
1141 ok(
item.state == 0x2aab,
"state %x\n",
item.state);
1150 item.stateMask = 0xffff;
1153 ok(
item.state == 0x1aab,
"state %x\n",
item.state);
1190 const LPARAM lparamTest = 0x42;
1199 ok(
hwnd !=
NULL,
"failed to create listview window\n");
1230 ok(
r,
"got %d\n",
r);
1253 ok(
r,
"got %d\n",
r);
1276 ok(
r,
"got %d\n",
r);
1283 item.lParam = lparamTest;
1294 ok(
item.lParam == lparamTest,
"got lParam %lx, expected %lx\n",
item.lParam, lparamTest);
1308 item.pszText = buffA;
1309 item.cchTextMax =
sizeof(buffA);
1326 item.pszText = buffA;
1328 item.cchTextMax =
sizeof(buffA);
1331 ok(
item.pszText[0] == 0,
"got %p\n",
item.pszText);
1346 item.pszText = buffA;
1348 item.cchTextMax =
sizeof(buffA);
1361 ok(
item.lParam == lparamTest,
"got lParam %lx, expected %lx\n",
item.lParam, lparamTest);
1368 item.lParam = lparamTest+1;
1379 ok(
item.lParam == lparamTest,
"got lParam %lx, expected %lx\n",
item.lParam, lparamTest);
1399 item.stateMask = -1;
1440 "check callback text comparison rule",
FALSE);
1456 ok(
hwnd !=
NULL,
"failed to create listview window\n");
1462 ok(rc == 0,
"got %d\n", rc);
1471 ok(
hwnd !=
NULL,
"failed to create listview window\n");
1474 ok(!rc,
"got %d\n", rc);
1477 ok(!rc,
"got %d\n", rc);
1483 ok(rc == 0,
"Inserting column with no mask failed with %d\n", rc);
1487 ok(rc == 10,
"Inserting column with no mask failed to set width to 10 with %d\n", rc);
1509 ok(
order[0] == 0,
"Expected order 0, got %d\n",
order[0]);
1510 ok(
order[1] == 1,
"Expected order 1, got %d\n",
order[1]);
1546 "get subitem text after column added",
FALSE);
1570#define TEST_NO_HEADER(a) test_header_presence_(a, FALSE, __LINE__)
1571#define TEST_HEADER_EXPECTED(a) test_header_presence_(a, TRUE, __LINE__)
1572#define TEST_NO_HEADER2(a, b) test_header_presence_(a, b, __LINE__)
1592 static const WCHAR testtextW[] = {
't',
'e',
's',
't',
' ',
't',
'e',
'x',
't',0};
1606 win_skip(
"Skipping some tests on XP.\n");
1612 ok(
r,
"Failed to get class info.\n");
1617 ok(
class,
"Failed to register class.\n");
1620 hList =
CreateWindowA(
"MyListView32",
"Test",
WS_VISIBLE, 0, 0, 100, 100,
NULL,
NULL,
GetModuleHandleA(
NULL), 0);
1628 hList =
CreateWindowA(
WC_LISTVIEWA,
"Test",
WS_VISIBLE, 0, 0, 100, 100,
NULL,
NULL,
GetModuleHandleA(
NULL), 0);
1757 ok(
r == 1,
"Unexpected ret value %d.\n",
r);
1759 ok(
rect.bottom >= 0,
"Unexpected rectangle.\n");
1769 "created with LVS_OWNERDRAWFIXED|LVS_REPORT - parent seq",
FALSE);
1775 ok(
hList !=
NULL,
"Failed to create ListView window.\n");
1783 ok(
hList !=
NULL,
"Failed to create ListView window.\n");
1790 ok(
r,
"Failed to unregister test class.\n");
1821 ok(
r == 1,
"Expected not zero result\n");
1823 "forward WM_ERASEBKGND on CLR_NONE",
FALSE);
1832 "don't forward WM_ERASEBKGND on non-CLR_NONE",
FALSE);
1844 "forward WM_ERASEBKGND on CLR_NONE",
FALSE);
1853 "don't forward WM_ERASEBKGND on non-CLR_NONE",
FALSE);
1900 ok(clr == c0ffee,
"clr=%.8x\n", clr);
1981 ok(
hwnd !=
NULL,
"failed to create a listview window\n");
2024 ok(
hwnd !=
NULL,
"failed to create a listview window\n");
2028 for (
i = 0;
i < 4;
i++)
2060 ok(
rect.right == 0 &&
rect.bottom == 0,
"got update rectangle\n");
2070 ok(
rect.right == 0 &&
rect.bottom == 0,
"got update rectangle\n");
2080 ok(
rect.right == 0 &&
rect.bottom == 0,
"got update rectangle\n");
2100 static CHAR item0text[] =
"item0";
2101 static CHAR item1text[] =
"item1";
2102 static CHAR item2text[] =
"item2";
2105 ok(
hwnd !=
NULL,
"failed to create a listview window\n");
2137 item1.pszText = item1text;
2145 item2.pszText = item2text;
2201 static CHAR item0text[] =
"item0";
2202 static CHAR item1text[] =
"item1";
2203 static CHAR item2text[] =
"item2";
2206 ok(
hwnd !=
NULL,
"failed to create a listview window\n");
2222 item1.pszText = item1text;
2230 item2.pszText = item2text;
2250 expect2(20, 20, position.
x, position.
y);
2266 position.
x = position.
y = 0;
2269 ok(
hwnd !=
NULL,
"failed to create a listview window\n");
2278 ok(
hwnd !=
NULL,
"failed to create a listview window\n");
2287 ok(
hwnd !=
NULL,
"failed to create a listview window\n");
2296 ok(
hwnd !=
NULL,
"failed to create a listview window\n");
2307 typedef struct t_select_task
2319 static const int items=5;
2326 static struct t_select_task
task_list[] = {
2327 {
"using VK_DOWN", 0,
VK_DOWN, -1, -1 },
2328 {
"using VK_UP", -1,
VK_UP, -1, -1 },
2329 {
"using VK_END", 0,
VK_END, 1, -1 },
2330 {
"using VK_HOME", -1,
VK_HOME, 1, -1 }
2342 ok(
r == -1,
"got %d\n",
r);
2345 ok(
r == -1,
"got %d\n",
r);
2348 ok(
r == 0,
"got %d\n",
r);
2352 ok(
r == 0,
"got %d\n",
r);
2355 ok(
r == 0,
"got %d\n",
r);
2358 ok(
r == 0,
"got %d\n",
r);
2361 ok(
r == 0,
"got %d\n",
r);
2364 DWORD selected_count;
2373 ok(
r,
"got %d\n",
r);
2378 ok(
r,
"got %d\n",
r);
2383 ok(
r,
"got %d\n",
r);
2386 ok(selected_count == 1,
"expected 1, got %d\n", selected_count);
2393 for (
j=1;
j<=(task.count == -1 ? item_count : task.count);
j++) {
2402 ok((task.result == -1 ? item_count : task.result) == selected_count,
2403 "Failed multiple selection %s. There should be %d selected items (is %d)\n",
2404 task.descr, item_count, selected_count);
2429 ok(
r,
"got %d\n",
r);
2439 "select all notification",
FALSE);
2456 "select all notification 2",
FALSE);
2464 ok(
r,
"got %d\n",
r);
2467 "deselect all notification",
FALSE);
2491 "set state all notification 3",
FALSE);
2494 ok(
r,
"got %d\n",
r);
2495 for (
i = 0;
i < 3;
i++) {
2499 ok(
r,
"got %d\n",
r);
2521 ok(
r == -1,
"got %d\n",
r);
2527 ok(
r,
"got %d\n",
r);
2548 ok(
r == -1,
"got %d\n",
r);
2711 ok(
hwnd !=
NULL,
"failed to create a listview window\n");
2769 ok(
r,
"got %d\n",
r);
2805 ok(
hwnd !=
NULL,
"failed to create a listview window\n");
2842 arr[0] = 1; arr[1] = 0; arr[2] = 2;
2864 ok(
rect2.
top > 0,
"expected positive item height\n");
2893 if (
first == second)
return 0;
2894 return (
first > second ? 1 : -1);
2903 static CHAR names[][5] = {
"A",
"B",
"C",
"D",
"0"};
2907 ok(
hwnd !=
NULL,
"failed to create a listview window\n");