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");
962 ok(
hwnd !=
NULL,
"Failed to create listview.\n");
968 ok(!
r,
"Failed to insert item.\n");
975 ok(
r,
"Failed to get item.\n");
985 ok(
r,
"Failed to get item.\n");
1003 ok(
hwnd !=
NULL,
"failed to create listview window\n");
1007 item.stateMask = 0xffff;
1008 item.state = 0xfccc;
1017 item.stateMask = 0xffff;
1020 ok(
item.state == 0xfccc,
"state %x\n",
item.state);
1024 item.stateMask = 0xffff;
1025 item.state = 0xfccc;
1034 item.stateMask = 0xffff;
1037 ok(
item.state == 0,
"state %x\n",
item.state);
1045 item.stateMask = 0xffff;
1048 if (
item.state != 0x1ccc)
1050 win_skip(
"LVS_EX_CHECKBOXES style is unavailable. Skipping.\n");
1059 item.pszText = text2;
1065 item.stateMask = 0xffff;
1068 ok(
item.state == 0x1000,
"state %x\n",
item.state);
1073 item.stateMask = 0xffff;
1074 item.state = 0x2aaa;
1075 item.pszText = text3;
1081 item.stateMask = 0xffff;
1084 ok(
item.state == 0x1aaa,
"state %x\n",
item.state);
1089 item.stateMask = 0xf000;
1090 item.state = 0x2000;
1096 item.stateMask = 0xffff;
1099 ok(
item.state == 0x2aaa,
"state %x\n",
item.state);
1106 item.stateMask = 0xf000;
1107 item.state = 0xffff;
1110 ok(
item.state == 0x2000,
"state %x\n",
item.state);
1118 item.stateMask = 0xffff;
1121 ok(
item.state == 0x2aaa,
"state %x\n",
item.state);
1129 item.stateMask = 0xffff;
1132 ok(
item.state == 0x2aaa,
"state %x\n",
item.state);
1140 item.stateMask = 0xffff;
1143 ok(
item.state == 0x1aaa,
"state %x\n",
item.state);
1157 item.stateMask = 0xffff;
1160 ok(
item.state == 0x1aab,
"state %x\n",
item.state);
1169 item.stateMask = 0xffff;
1172 ok(
item.state == 0x2aab,
"state %x\n",
item.state);
1181 item.stateMask = 0xffff;
1184 ok(
item.state == 0x1aab,
"state %x\n",
item.state);
1221 const LPARAM lparamTest = 0x42;
1230 ok(
hwnd !=
NULL,
"failed to create listview window\n");
1261 ok(
r,
"got %d\n",
r);
1284 ok(
r,
"got %d\n",
r);
1307 ok(
r,
"got %d\n",
r);
1314 item.lParam = lparamTest;
1325 ok(
item.lParam == lparamTest,
"got lParam %lx, expected %lx\n",
item.lParam, lparamTest);
1339 item.pszText = buffA;
1340 item.cchTextMax =
sizeof(buffA);
1357 item.pszText = buffA;
1359 item.cchTextMax =
sizeof(buffA);
1362 ok(
item.pszText[0] == 0,
"got %p\n",
item.pszText);
1377 item.pszText = buffA;
1379 item.cchTextMax =
sizeof(buffA);
1392 ok(
item.lParam == lparamTest,
"got lParam %lx, expected %lx\n",
item.lParam, lparamTest);
1399 item.lParam = lparamTest+1;
1410 ok(
item.lParam == lparamTest,
"got lParam %lx, expected %lx\n",
item.lParam, lparamTest);
1430 item.stateMask = -1;
1471 "check callback text comparison rule",
FALSE);
1487 ok(
hwnd !=
NULL,
"failed to create listview window\n");
1493 ok(rc == 0,
"got %d\n", rc);
1502 ok(
hwnd !=
NULL,
"failed to create listview window\n");
1505 ok(!rc,
"got %d\n", rc);
1508 ok(!rc,
"got %d\n", rc);
1514 ok(rc == 0,
"Inserting column with no mask failed with %d\n", rc);
1518 ok(rc == 10,
"Inserting column with no mask failed to set width to 10 with %d\n", rc);
1540 ok(
order[0] == 0,
"Expected order 0, got %d\n",
order[0]);
1541 ok(
order[1] == 1,
"Expected order 1, got %d\n",
order[1]);
1577 "get subitem text after column added",
FALSE);
1583 ok(
hwnd !=
NULL,
"Failed to create a listview window.\n");
1590 ok(!rc,
"Unexpected column count.\n");
1614#define TEST_NO_HEADER(a) test_header_presence_(a, FALSE, __LINE__)
1615#define TEST_HEADER_EXPECTED(a) test_header_presence_(a, TRUE, __LINE__)
1616#define TEST_NO_HEADER2(a, b) test_header_presence_(a, b, __LINE__)
1636 static const WCHAR testtextW[] = {
't',
'e',
's',
't',
' ',
't',
'e',
'x',
't',0};
1650 win_skip(
"Skipping some tests on XP.\n");
1656 ok(
r,
"Failed to get class info.\n");
1661 ok(
class,
"Failed to register class.\n");
1664 hList =
CreateWindowA(
"MyListView32",
"Test",
WS_VISIBLE, 0, 0, 100, 100,
NULL,
NULL,
GetModuleHandleA(
NULL), 0);
1672 hList =
CreateWindowA(
WC_LISTVIEWA,
"Test",
WS_VISIBLE, 0, 0, 100, 100,
NULL,
NULL,
GetModuleHandleA(
NULL), 0);
1801 ok(
r == 1,
"Unexpected ret value %d.\n",
r);
1803 ok(
rect.bottom >= 0,
"Unexpected rectangle.\n");
1813 "created with LVS_OWNERDRAWFIXED|LVS_REPORT - parent seq",
FALSE);
1819 ok(
hList !=
NULL,
"Failed to create ListView window.\n");
1827 ok(
hList !=
NULL,
"Failed to create ListView window.\n");
1834 ok(
r,
"Failed to unregister test class.\n");
1865 ok(
r == 1,
"Expected not zero result\n");
1867 "forward WM_ERASEBKGND on CLR_NONE",
FALSE);
1876 "don't forward WM_ERASEBKGND on non-CLR_NONE",
FALSE);
1888 "forward WM_ERASEBKGND on CLR_NONE",
FALSE);
1897 "don't forward WM_ERASEBKGND on non-CLR_NONE",
FALSE);
1938 ok(clr == c0ffee,
"Unexpected background color %#x.\n", clr);
1949 if (showsel_always && is_selected && nmlvcd->
iSubItem)
1953 ok(clr == c0ffee,
"clr=%.8x\n", clr);
1957 if (showsel_always && is_selected)
1962 ok(clr == c0ffee,
"Unexpected background color %#x.\n", clr);
2013 "parent customdraw, item selected, LVS_REPORT, selection",
FALSE);
2020 "parent customdraw, item selected, LVS_SHOWSELALWAYS, LVS_REPORT",
FALSE);
2049 ok(
hwnd !=
NULL,
"failed to create a listview window\n");
2092 ok(
hwnd !=
NULL,
"failed to create a listview window\n");
2096 for (
i = 0;
i < 4;
i++)
2128 ok(
rect.right == 0 &&
rect.bottom == 0,
"got update rectangle\n");
2138 ok(
rect.right == 0 &&
rect.bottom == 0,
"got update rectangle\n");
2148 ok(
rect.right == 0 &&
rect.bottom == 0,
"got update rectangle\n");
2168 static CHAR item0text[] =
"item0";
2169 static CHAR item1text[] =
"item1";
2170 static CHAR item2text[] =
"item2";
2173 ok(
hwnd !=
NULL,
"failed to create a listview window\n");
2205 item1.pszText = item1text;
2213 item2.pszText = item2text;
2269 static CHAR item0text[] =
"item0";
2270 static CHAR item1text[] =
"item1";
2271 static CHAR item2text[] =
"item2";
2274 ok(
hwnd !=
NULL,
"failed to create a listview window\n");
2290 item1.pszText = item1text;
2298 item2.pszText = item2text;
2318 expect2(20, 20, position.
x, position.
y);
2334 position.
x = position.
y = 0;
2337 ok(
hwnd !=
NULL,
"failed to create a listview window\n");
2346 ok(
hwnd !=
NULL,
"failed to create a listview window\n");
2355 ok(
hwnd !=
NULL,
"failed to create a listview window\n");
2364 ok(
hwnd !=
NULL,
"failed to create a listview window\n");
2375 typedef struct t_select_task
2387 static const int items=5;
2394 static struct t_select_task
task_list[] = {
2395 {
"using VK_DOWN", 0,
VK_DOWN, -1, -1 },
2396 {
"using VK_UP", -1,
VK_UP, -1, -1 },
2397 {
"using VK_END", 0,
VK_END, 1, -1 },
2398 {
"using VK_HOME", -1,
VK_HOME, 1, -1 }
2410 ok(
r == -1,
"got %d\n",
r);
2413 ok(
r == -1,
"got %d\n",
r);
2416 ok(
r == 0,
"got %d\n",
r);
2420 ok(
r == 0,
"got %d\n",
r);
2423 ok(
r == 0,
"got %d\n",
r);
2426 ok(
r == 0,
"got %d\n",
r);
2429 ok(
r == 0,
"got %d\n",
r);
2432 DWORD selected_count;
2441 ok(
r,
"got %d\n",
r);
2446 ok(
r,
"got %d\n",
r);
2451 ok(
r,
"got %d\n",
r);
2454 ok(selected_count == 1,
"expected 1, got %d\n", selected_count);
2461 for (
j=1;
j<=(task.count == -1 ? item_count : task.count);
j++) {
2470 ok((task.result == -1 ? item_count : task.result) == selected_count,
2471 "Failed multiple selection %s. There should be %d selected items (is %d)\n",
2472 task.descr, item_count, selected_count);
2497 ok(
r,
"got %d\n",
r);
2507 "select all notification",
FALSE);
2524 "select all notification 2",
FALSE);
2532 ok(
r,
"got %d\n",
r);
2535 "deselect all notification",
FALSE);
2559 "set state all notification 3",
FALSE);
2562 ok(
r,
"got %d\n",
r);
2563 for (
i = 0;
i < 3;
i++) {
2567 ok(
r,
"got %d\n",
r);
2589 ok(
r == -1,
"got %d\n",
r);
2595 ok(
r,
"got %d\n",
r);
2616 ok(
r == -1,
"got %d\n",
r);
2779 ok(
hwnd !=
NULL,
"failed to create a listview window\n");
2837 ok(
r,
"got %d\n",
r);
2873 ok(
hwnd !=
NULL,
"failed to create a listview window\n");
2910 arr[0] = 1; arr[1] = 0; arr[2] = 2;