ReactOS
0.4.16-dev-329-g9223134
DestroyCursorIcon.c
Go to the documentation of this file.
1
2
#include "
precomp.h
"
3
4
START_TEST
(DestroyCursorIcon)
5
{
6
HICON
hicon;
7
HCURSOR
hcursor;
8
ICONINFO
iconinfo;
9
10
ZeroMemory
(&iconinfo,
sizeof
(iconinfo));
11
12
iconinfo.
hbmMask
=
CreateBitmap
(8, 16, 1, 1,
NULL
);
13
ok
(iconinfo.
hbmMask
!=
NULL
,
"\n"
);
14
15
/*
16
* Test if DestroyCursor can destroy an icon, and vice-versa .
17
* It can.
18
*/
19
iconinfo.
fIcon
=
TRUE
;
20
hicon =
CreateIconIndirect
(&iconinfo);
21
ok
(hicon != 0,
"should not fail\n"
);
22
ok
(
DestroyCursor
(hicon),
"\n"
);
23
ok
(!
DestroyIcon
(hicon),
"\n"
);
24
25
iconinfo.
fIcon
=
FALSE
;
26
hcursor =
CreateIconIndirect
(&iconinfo);
27
ok
(hcursor != 0,
"should not fail\n"
);
28
ok
(
DestroyIcon
(hcursor),
"\n"
);
29
ok
(!
DestroyCursor
(hcursor),
"\n"
);
30
31
/* Clean up */
32
DeleteObject
(iconinfo.
hbmMask
);
33
34
/* Now check its behaviour regarding Shared icons/cursors */
35
hcursor =
LoadCursor
(
GetModuleHandle
(
NULL
),
"TESTCURSOR"
);
36
ok
(hcursor != 0,
"\n"
);
37
38
/* MSDN says we shouldn't do that, but it still succeeds */
39
ok
(
DestroyCursor
(hcursor),
"\n"
);
40
41
/* In fact, it's still there */
42
ZeroMemory
(&iconinfo,
sizeof
(iconinfo));
43
ok
(
GetIconInfo
(hcursor, &iconinfo),
"\n"
);
44
ok
(iconinfo.
hbmMask
!=
NULL
,
"\n"
);
45
ok
(iconinfo.
hbmColor
!=
NULL
,
"\n"
);
46
ok
(!iconinfo.
fIcon
,
"\n"
);
47
48
/* clean up */
49
DeleteObject
(iconinfo.
hbmMask
);
50
DeleteObject
(iconinfo.
hbmColor
);
51
}
ok
#define ok(value,...)
Definition:
atltest.h:57
START_TEST
#define START_TEST(x)
Definition:
atltest.h:75
NULL
#define NULL
Definition:
types.h:112
TRUE
#define TRUE
Definition:
types.h:120
FALSE
#define FALSE
Definition:
types.h:117
DeleteObject
pKey DeleteObject()
HICON
static HICON
Definition:
imagelist.c:80
_ICONINFO
Definition:
winuser.h:3125
_ICONINFO::fIcon
BOOL fIcon
Definition:
winuser.h:3126
_ICONINFO::hbmColor
HBITMAP hbmColor
Definition:
winuser.h:3130
_ICONINFO::hbmMask
HBITMAP hbmMask
Definition:
winuser.h:3129
precomp.h
ZeroMemory
#define ZeroMemory
Definition:
winbase.h:1737
GetModuleHandle
#define GetModuleHandle
Definition:
winbase.h:3852
HCURSOR
HICON HCURSOR
Definition:
windef.h:299
CreateBitmap
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)
CreateIconIndirect
HICON WINAPI CreateIconIndirect(_In_ PICONINFO)
Definition:
cursoricon.c:2633
DestroyCursor
BOOL WINAPI DestroyCursor(_In_ HCURSOR)
Definition:
cursoricon.c:2741
GetIconInfo
BOOL WINAPI GetIconInfo(_In_ HICON, _Out_ PICONINFO)
Definition:
cursoricon.c:2097
LoadCursor
#define LoadCursor
Definition:
winuser.h:5824
DestroyIcon
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition:
cursoricon.c:2105
modules
rostests
apitests
user32
DestroyCursorIcon.c
Generated on Sat Dec 7 2024 06:07:44 for ReactOS by
1.9.6