ReactOS  0.4.15-dev-1374-g8d3e80e
DrawIconEx.c File Reference
#include "precomp.h"
Include dependency graph for DrawIconEx.c:

Go to the source code of this file.

Functions

 START_TEST (DrawIconEx)
 

Function Documentation

◆ START_TEST()

START_TEST ( DrawIconEx  )

Definition at line 4 of file DrawIconEx.c.

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 
54  DeleteDC(hdc);
55 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
static HBRUSH hbrush
HDC WINAPI GetDC(_In_opt_ HWND)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
static HDC
Definition: imagelist.c:92
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1499
#define ZeroMemory
Definition: winbase.h:1648
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
HICON HCURSOR
Definition: windef.h:299
unsigned int BOOL
Definition: ntddk_ex.h:94
HBITMAP hbmMask
Definition: winuser.h:3101
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HBITMAP hbmColor
Definition: winuser.h:3102
HBITMAP hbmp
BOOL WINAPI DestroyCursor(_In_ HCURSOR)
Definition: cursoricon.c:2654
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:1997
HICON WINAPI CreateIconIndirect(_In_ PICONINFO)
Definition: cursoricon.c:2546
int ret
HDC hdc
Definition: main.c:9
#define DKGRAY_BRUSH
Definition: wingdi.h:896
#define DI_NORMAL
Definition: wingdi.h:72
BOOL WINAPI DeleteDC(_In_ HDC)
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
static HBITMAP
Definition: button.c:44
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)