1 
2 #include "precomp.h"
3 
START_TEST(DrawIconEx)4 START_TEST(DrawIconEx)
5 {
6     HCURSOR hcursor;
7     HBITMAP hbmp;
8     ICONINFO ii;
9     HDC hdcScreen, hdc;
10     BOOL ret;
11     HBRUSH hbrush;
12 
13     ZeroMemory(&ii, sizeof(ii));
14 
15     ii.hbmMask = CreateBitmap(8, 16, 1, 1, NULL);
16     ok(ii.hbmMask != NULL, "\n");
17     hcursor = CreateIconIndirect(&ii);
18     ok(hcursor != NULL, "\n");
19     DeleteObject(ii.hbmMask);
20 
21     hdcScreen = GetDC(0);
22     hbmp = CreateCompatibleBitmap(hdcScreen, 8, 8);
23     ok(hbmp != NULL, "\n");
24     hdc = CreateCompatibleDC(hdcScreen);
25     ok(hdc != NULL, "\n");
26     ReleaseDC(0, hdcScreen);
27 
28     hbmp = SelectObject(hdc, hbmp);
29     ok(hbmp != NULL, "\n");
30 
31     hbrush = GetStockObject(DKGRAY_BRUSH);
32     ok(hbrush != NULL, "\n");
33 
34     ret = DrawIconEx(hdc, 0, 0, hcursor, 8, 8, 0, hbrush, DI_NORMAL);
35     ok(ret, "\n");
36     DestroyCursor(hcursor);
37 
38     /* Try with color */
39     ii.hbmMask = CreateBitmap(8, 8, 1, 1, NULL);
40     ok(ii.hbmMask != NULL, "\n");
41     ii.hbmColor = CreateBitmap(8, 8, 16, 1, NULL);
42     ok(ii.hbmColor != NULL, "\n");
43     hcursor = CreateIconIndirect(&ii);
44     ok(hcursor != NULL, "\n");
45     DeleteObject(ii.hbmMask);
46     DeleteObject(ii.hbmColor);
47 
48     ret = DrawIconEx(hdc, 0, 0, hcursor, 8, 8, 0, hbrush, DI_NORMAL);
49     ok(ret, "\n");
50     DestroyCursor(hcursor);
51 
52     hbmp = SelectObject(hdc, hbmp);
53     DeleteObject(hbmp);
54     DeleteDC(hdc);
55 }
56