diff --git a/rostests/apitests/user32/LoadImage.c b/rostests/apitests/user32/LoadImage.c index ef6b8de5c7f..3ae9dda3898 100644 --- a/rostests/apitests/user32/LoadImage.c +++ b/rostests/apitests/user32/LoadImage.c @@ -21,10 +21,48 @@ START_TEST(LoadImage) if (argc >= 3) { HANDLE arg; + HICON hCopy; + HBITMAP hbmp; + HDC hdc, hdcScreen; + ICONINFO ii; sscanf (test_argv[2], "%lu", (ULONG_PTR*) &arg); ok(handle != arg, "Got same handles\n"); + + /* Try copying it */ + hCopy = CopyIcon(arg); + ok(hCopy != NULL, "\n"); + ok(DestroyIcon(hCopy), "\n"); + + hCopy = CopyImage(arg, IMAGE_CURSOR, 0, 0, 0); + ok(hCopy != NULL, "\n"); + ok(DestroyIcon(hCopy), "\n"); + + hCopy = CopyImage(arg, IMAGE_CURSOR, 0, 0, LR_COPYFROMRESOURCE); + ok(hCopy != NULL, "\n"); + ok(DestroyIcon(hCopy), "\n"); + + /* Try various usual functions */ + hdcScreen = CreateDCW(L"DISPLAY", NULL, NULL, NULL); + ok(hdcScreen != NULL, "\n"); + hdc = CreateCompatibleDC(hdcScreen); + ok(hdc != NULL, "\n"); + hbmp = CreateCompatibleBitmap(hdcScreen, 64, 64); + ok(hbmp != NULL, "\n"); + hbmp = SelectObject(hdc, hbmp); + ok(hbmp != NULL, "\n"); + + ok(DrawIcon(hdc, 0, 0, arg), "\n"); + hbmp = SelectObject(hdc, hbmp); + DeleteObject(hbmp); + DeleteDC(hdc); + DeleteDC(hdcScreen); + + ok(GetIconInfo(arg, &ii), "\n"); + ok(ii.hbmMask != NULL, "\n"); + DeleteObject(ii.hbmMask); + if(ii.hbmColor) DeleteObject(ii.hbmColor); return; } @@ -35,4 +73,4 @@ START_TEST(LoadImage) si.cb = sizeof(si); CreateProcessA( NULL, path, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi ); WaitForSingleObject (pi.hProcess, INFINITE); -} \ No newline at end of file +}