ReactOS 0.4.15-dev-7659-ga55345b
DrawIconEx.c
Go to the documentation of this file.
1
2#include "precomp.h"
3
5{
6 HCURSOR hcursor;
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");
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
29 ok(hbmp != NULL, "\n");
30
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");
47
48 ret = DrawIconEx(hdc, 0, 0, hcursor, 8, 8, 0, hbrush, DI_NORMAL);
49 ok(ret, "\n");
50 DestroyCursor(hcursor);
51
55}
static HBRUSH hbrush
#define ok(value,...)
Definition: atltest.h:57
#define START_TEST(x)
Definition: atltest.h:75
HBITMAP hbmp
#define NULL
Definition: types.h:112
unsigned int BOOL
Definition: ntddk_ex.h:94
pKey DeleteObject()
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:92
HBITMAP hbmColor
Definition: winuser.h:3126
HBITMAP hbmMask
Definition: winuser.h:3125
int ret
#define ZeroMemory
Definition: winbase.h:1712
HICON HCURSOR
Definition: windef.h:299
HGDIOBJ WINAPI GetStockObject(_In_ int)
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)
#define DKGRAY_BRUSH
Definition: wingdi.h:897
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
#define DI_NORMAL
Definition: wingdi.h:72
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
BOOL WINAPI DeleteDC(_In_ HDC)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HICON WINAPI CreateIconIndirect(_In_ PICONINFO)
Definition: cursoricon.c:2564
BOOL WINAPI DestroyCursor(_In_ HCURSOR)
Definition: cursoricon.c:2672
BOOL WINAPI DrawIconEx(_In_ HDC, _In_ int, _In_ int, _In_ HICON, _In_ int, _In_ int, _In_ UINT, _In_opt_ HBRUSH, _In_ UINT)
Definition: cursoricon.c:2011
HDC WINAPI GetDC(_In_opt_ HWND)