1 /* 2 * PROJECT: ReactOS api tests 3 * LICENSE: GPL - See COPYING in the top level directory 4 * PURPOSE: Test for NtGdiCreateCompatibleDC 5 * PROGRAMMERS: 6 */ 7 8 #include "../win32nt.h" 9 10 START_TEST(NtGdiCreateCompatibleDC) 11 { 12 HDC hDC; 13 HGDIOBJ hObj; 14 15 /* Test if aa NULL DC is accepted */ 16 hDC = NtGdiCreateCompatibleDC(NULL); 17 ok(hDC != NULL, "hDC was NULL.\n"); 18 19 /* We select a nwe palette. Note: SelectObject doesn't work with palettes! */ 20 hObj = SelectPalette(hDC, GetStockObject(DEFAULT_PALETTE), 0); 21 /* The old palette should be GetStockObject(DEFAULT_PALETTE) */ 22 ok_ptr(hObj, GetStockObject(DEFAULT_PALETTE)); 23 24 /* The default bitmap should be GetStockObject(21) */ 25 hObj = SelectObject(hDC, GetStockObject(21)); 26 ok_ptr(hObj, GetStockObject(21)); 27 28 /* The default pen should be GetStockObject(BLACK_PEN) */ 29 hObj = SelectObject(hDC, GetStockObject(WHITE_PEN)); 30 ok_ptr(hObj, GetStockObject(BLACK_PEN)); 31 32 ok(NtGdiDeleteObjectApp(hDC) != 0, "NtGdiDeleteObjectApp(hDC) was zero.\n"); 33 } 34