4 * Copyright 2006 Mike McCormack for CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 #include "wine/test.h"
29 HWND hwnd, hwndparent = 0;
30 INITCOMMONCONTROLSEX icc;
36 static CHAR hello[] = "hello";
39 icc.dwSize = sizeof icc;
40 InitCommonControlsEx(&icc);
42 himl = ImageList_Create(40, 40, 0, 4, 4);
43 ok(himl != NULL, "failed to create imagelist\n");
45 hbmp = CreateBitmap(40, 40, 1, 1, NULL);
46 ok(hbmp != NULL, "failed to create bitmap\n");
48 r = ImageList_Add(himl, hbmp, 0);
49 ok(r == 0, "should be zero\n");
51 hwnd = CreateWindowEx(0, "SysListView32", "foo", LVS_OWNERDRAWFIXED,
52 10, 10, 100, 200, hwndparent, NULL, NULL, NULL);
53 ok(hwnd != NULL, "failed to create listview window\n");
55 r = SendMessage(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, 0x940);
56 ok(r == 0, "should return zero\n");
58 r = SendMessage(hwnd, LVM_SETIMAGELIST, 0, (LPARAM)himl);
59 ok(r == 0, "should return zero\n");
61 r = SendMessage(hwnd, LVM_SETICONSPACING, 0, MAKELONG(100,50));
62 /* returns dimensions */
64 r = SendMessage(hwnd, LVM_GETITEMCOUNT, 0, 0);
65 ok(r == 0, "should be zero items\n");
67 item.mask = LVIF_IMAGE | LVIF_TEXT;
71 r = SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM) &item);
72 ok(r == -1, "should fail\n");
76 r = SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM) &item);
77 ok(r == 0, "should not fail\n");
79 memset(&r1, 0, sizeof r1);
81 r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM) &r1);
83 r = SendMessage(hwnd, LVM_DELETEALLITEMS, 0, 0);
84 ok(r == TRUE, "should not fail\n");
88 r = SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM) &item);
89 ok(r == 0, "should not fail\n");
91 memset(&r2, 0, sizeof r2);
93 r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM) &r2);
95 ok(!memcmp(&r1, &r2, sizeof r1), "rectangle should be the same\n");