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