1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

gdiplus/tests: Add test for cursor with GdipCreateBitmapFromHICON.

This commit is contained in:
Jeff Smith 2023-08-21 15:55:53 -05:00 committed by Alexandre Julliard
parent 5e5b7d560f
commit 159e346547

View file

@ -1573,18 +1573,17 @@ static void test_fromhicon(void)
stat = GdipCreateBitmapFromHICON(NULL, &bitmap);
expect(InvalidParameter, stat);
/* color icon 1 bit */
/* monochrome icon */
hbmMask = CreateBitmap(16, 16, 1, 1, bmp_bits);
ok(hbmMask != 0, "CreateBitmap failed\n");
hbmColor = CreateBitmap(16, 16, 1, 1, bmp_bits);
ok(hbmColor != 0, "CreateBitmap failed\n");
info = iconinfo_base;
info.hbmMask = hbmMask;
info.hbmColor = hbmColor;
hIcon = CreateIconIndirect(&info);
ok(hIcon != 0, "CreateIconIndirect failed\n");
DeleteObject(hbmMask);
DeleteObject(hbmColor);
stat = GdipCreateBitmapFromHICON(hIcon, &bitmap);
ok(stat == Ok ||
@ -1597,11 +1596,31 @@ static void test_fromhicon(void)
}
DestroyIcon(hIcon);
/* color icon 8 bpp */
hbmMask = CreateBitmap(16, 16, 1, 8, bmp_bits);
/* monochrome cursor */
info.fIcon = FALSE;
info.xHotspot = 8;
info.yHotspot = 8;
info.hbmMask = hbmMask;
info.hbmColor = hbmColor;
hIcon = CreateIconIndirect(&info);
ok(hIcon != 0, "CreateIconIndirect failed\n");
stat = GdipCreateBitmapFromHICON(hIcon, &bitmap);
todo_wine
expect(InvalidParameter, stat);
if (stat == Ok)
GdipDisposeImage((GpImage*)bitmap);
DestroyIcon(hIcon);
DeleteObject(hbmMask);
DeleteObject(hbmColor);
/* 8 bpp icon */
hbmMask = CreateBitmap(16, 16, 1, 1, bmp_bits);
ok(hbmMask != 0, "CreateBitmap failed\n");
hbmColor = CreateBitmap(16, 16, 1, 8, bmp_bits);
ok(hbmColor != 0, "CreateBitmap failed\n");
info = iconinfo_base;
info.hbmMask = hbmMask;
info.hbmColor = hbmColor;