mirror of
https://github.com/reactos/reactos.git
synced 2025-01-05 22:12:46 +00:00
[USER32_APITEST]
- Test behaviour with icons handle from foreign process svn path=/trunk/; revision=57681
This commit is contained in:
parent
e8624870c3
commit
26504938df
1 changed files with 39 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue