42 #define UXTHEME_GET_PROC(func) p ## func = (void*)GetProcAddress(hUxtheme, #func) 53 #undef UXTHEME_GET_PROC 66 trace(
"Test executable is %s\n", (bAppThemed) ?
"themed" :
"not themed");
70 ok( bTPDefined ==
FALSE,
"Expected FALSE\n");
72 "Expected E_HANDLE, got 0x%08x\n",
83 ok( hTheme ==
NULL,
"Expected a NULL return, got %p\n", hTheme);
86 "Expected E_HANDLE, got 0x%08x\n",
90 hWnd =
CreateWindowExA(0,
"static",
"",
WS_POPUP, 0,0,100,100,0, 0, 0,
NULL);
91 ok(
hWnd !=
NULL,
"Failed to create a test window.\n");
95 ok( hTheme ==
NULL,
"Expected a NULL return, got %p\n", hTheme);
97 "Expected 0xdeadbeef, got 0x%08x\n",
110 ok( hRes ==
E_HANDLE,
"Expected E_HANDLE, got 0x%08x\n", hRes);
113 hWnd =
CreateWindowExA(0,
"static",
"",
WS_POPUP, 0,0,100,100,0, 0, 0,
NULL);
114 ok(
hWnd !=
NULL,
"Failed to create a test window.\n");
117 ok( hRes ==
S_OK,
"Expected S_OK, got 0x%08x\n", hRes);
130 WCHAR szInvalidClassList[] = {
'D',
'E',
'A',
'D',
'B',
'E',
'E',
'F', 0 };
131 WCHAR szButtonClassList[] = {
'B',
'u',
't',
't',
'o',
'n', 0 };
132 WCHAR szButtonClassList2[] = {
'b',
'U',
't',
'T',
'o',
'N', 0 };
133 WCHAR szClassList[] = {
'B',
'u',
't',
't',
'o',
'n',
';',
'L',
'i',
's',
't',
'B',
'o',
'x', 0 };
140 ok( hTheme ==
NULL,
"Expected a NULL return, got %p\n", hTheme);
142 "Expected GLE() to be E_POINTER, got 0x%08x\n",
148 ok( hTheme ==
NULL,
"Expected a NULL return, got %p\n", hTheme);
151 "Expected GLE() to be E_PROP_ID_UNSUPPORTED, got 0x%08x\n",
158 ok( hTheme !=
NULL,
"got NULL, expected a HTHEME handle\n");
161 "Expected ERROR_SUCCESS, got 0x%08x\n",
166 ok( hTheme ==
NULL,
"Expected a NULL return, got %p\n", hTheme);
169 "Expected GLE() to be E_PROP_ID_UNSUPPORTED, got 0x%08x\n",
174 hWnd =
CreateWindowExA(0,
"static",
"",
WS_POPUP, 0,0,100,100,0, 0, 0,
NULL);
179 ok( hTheme ==
NULL,
"Expected a NULL return, got %p\n", hTheme);
181 "Expected GLE() to be E_POINTER, got 0x%08x\n",
186 ok( hTheme ==
NULL,
"Expected a NULL return, got %p\n", hTheme);
189 "Expected GLE() to be E_PROP_ID_UNSUPPORTED, got 0x%08x\n",
194 ok( hRes ==
E_HANDLE,
"Expected E_HANDLE, got 0x%08x\n", hRes);
200 ok( hTheme ==
NULL,
"Expected a NULL return, got %p\n", hTheme);
203 "Expected GLE() to be E_PROP_ID_UNSUPPORTED, got 0x%08x\n",
205 skip(
"No active theme, skipping rest of OpenThemeData tests\n");
213 ok( hTheme !=
NULL,
"got NULL, expected a HTHEME handle\n");
216 "Expected ERROR_SUCCESS, got 0x%08x\n",
222 ok( hTheme !=
NULL,
"got NULL, expected a HTHEME handle\n");
225 "Expected ERROR_SUCCESS, got 0x%08x\n",
230 ok( hTheme !=
NULL,
"got NULL, expected a HTHEME handle\n");
233 "Expected ERROR_SUCCESS, got 0x%08x\n",
239 ok( hTheme == hTheme2,
"Expected the same HTHEME handle (%p<->%p)\n",
242 "Expected 0xdeadbeef, got 0x%08x\n",
246 ok( hRes ==
S_OK,
"Expected S_OK, got 0x%08x\n", hRes);
250 ok( hRes ==
S_OK,
"Expected S_OK, got 0x%08x\n", hRes);
256 ok( hTheme == hTheme2,
"Expected the same HTHEME handle (%p<->%p)\n",
259 "Expected 0xdeadbeef, got 0x%08x\n",
266 ok( bTPDefined ==
FALSE,
"Expected FALSE\n");
268 "Expected ERROR_SUCCESS, got 0x%08x\n",
281 WCHAR szInvalidClassList[] = {
'D',
'E',
'A',
'D',
'B',
'E',
'E',
'F', 0 };
282 WCHAR szButtonClassList[] = {
'B',
'u',
't',
't',
'o',
'n', 0 };
283 WCHAR szButtonClassList2[] = {
'b',
'U',
't',
'T',
'o',
'N', 0 };
284 WCHAR szClassList[] = {
'B',
'u',
't',
't',
'o',
'n',
';',
'L',
'i',
's',
't',
'B',
'o',
'x', 0 };
286 if (!pOpenThemeDataEx)
288 win_skip(
"OpenThemeDataEx not available\n");
296 hTheme = pOpenThemeDataEx(
NULL,
NULL, 0);
297 ok( hTheme ==
NULL,
"Expected a NULL return, got %p\n", hTheme);
299 "Expected GLE() to be E_POINTER, got 0x%08x\n",
304 hTheme = pOpenThemeDataEx(
NULL, szInvalidClassList, 0);
305 ok( hTheme ==
NULL,
"Expected a NULL return, got %p\n", hTheme);
308 "Expected GLE() to be E_PROP_ID_UNSUPPORTED, got 0x%08x\n",
312 hTheme = pOpenThemeDataEx(
NULL, szClassList, 0);
315 ok( hTheme !=
NULL,
"got NULL, expected a HTHEME handle\n");
318 "Expected ERROR_SUCCESS, got 0x%08x\n",
323 ok( hTheme ==
NULL,
"Expected a NULL return, got %p\n", hTheme);
326 "Expected GLE() to be E_PROP_ID_UNSUPPORTED, got 0x%08x\n",
331 hWnd =
CreateWindowExA(0,
"static",
"",
WS_POPUP, 0,0,100,100,0, 0, 0,
NULL);
335 hTheme = pOpenThemeDataEx(
hWnd,
NULL, 0);
336 ok( hTheme ==
NULL,
"Expected a NULL return, got %p\n", hTheme);
338 "Expected GLE() to be E_POINTER, got 0x%08x\n",
342 hTheme = pOpenThemeDataEx(
hWnd, szInvalidClassList, 0);
343 ok( hTheme ==
NULL,
"Expected a NULL return, got %p\n", hTheme);
346 "Expected GLE() to be E_PROP_ID_UNSUPPORTED, got 0x%08x\n",
352 hTheme = pOpenThemeDataEx(
hWnd, szButtonClassList, 0);
353 ok( hTheme ==
NULL,
"Expected a NULL return, got %p\n", hTheme);
356 "Expected GLE() to be E_PROP_ID_UNSUPPORTED, got 0x%08x\n",
358 skip(
"No active theme, skipping rest of OpenThemeDataEx tests\n");
365 hTheme = pOpenThemeDataEx(
hWnd, szButtonClassList, 0);
366 ok( hTheme !=
NULL,
"got NULL, expected a HTHEME handle\n");
369 "Expected ERROR_SUCCESS, got 0x%08x\n",
373 hTheme = pOpenThemeDataEx(
hWnd, szButtonClassList, OTD_FORCE_RECT_SIZING);
374 ok( hTheme !=
NULL,
"got NULL, expected a HTHEME handle\n");
377 "Expected ERROR_SUCCESS, got 0x%08x\n",
381 hTheme = pOpenThemeDataEx(
hWnd, szButtonClassList, OTD_NONCLIENT);
382 ok( hTheme !=
NULL,
"got NULL, expected a HTHEME handle\n");
385 "Expected ERROR_SUCCESS, got 0x%08x\n",
389 hTheme = pOpenThemeDataEx(
hWnd, szButtonClassList, 0x3);
390 ok( hTheme !=
NULL,
"got NULL, expected a HTHEME handle\n");
393 "Expected ERROR_SUCCESS, got 0x%08x\n",
398 hTheme = pOpenThemeDataEx(
hWnd, szButtonClassList2, 0);
399 ok( hTheme !=
NULL,
"got NULL, expected a HTHEME handle\n");
402 "Expected ERROR_SUCCESS, got 0x%08x\n",
406 hTheme = pOpenThemeDataEx(
hWnd, szClassList, 0);
407 ok( hTheme !=
NULL,
"got NULL, expected a HTHEME handle\n");
410 "Expected ERROR_SUCCESS, got 0x%08x\n",
429 ok( hRes ==
S_OK,
"Expected S_OK, got 0x%08x\n", hRes);
445 "Expected E_NOT_SUFFICIENT_BUFFER, got 0x%08x\n", hRes);
456 "Expected E_NOT_SUFFICIENT_BUFFER, got 0x%08x\n", hRes);
463 ok( hRes ==
S_OK,
"Expected S_OK, got 0x%08x\n", hRes);
470 ok( hRes ==
E_POINTER || hRes ==
S_OK,
"Expected E_POINTER or S_OK, got 0x%08x\n", hRes);
474 "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes);
478 sizeof(currentTheme), currentSize,
ARRAY_SIZE(currentSize));
480 ok( hRes ==
S_OK,
"Expected S_OK, got 0x%08x\n", hRes);
485 ARRAY_SIZE(currentTheme), currentSize,
sizeof(currentSize));
487 ok( hRes ==
S_OK,
"Expected S_OK, got 0x%08x\n", hRes);
495 ok( hRes ==
S_OK,
"Expected S_OK, got 0x%08x\n", hRes);
505 ok( hRes ==
E_HANDLE,
"Expected E_HANDLE, got 0x%08x\n", hRes);
507 ok( hRes ==
E_HANDLE,
"Expected E_HANDLE, got 0x%08x\n", hRes);
512 static const XFORM ident = { 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f };
519 ok(
ret,
"Failed to get world transform\n");
520 ok(!
memcmp(&xform, &
ident,
sizeof(xform)),
"Unexpected world transform\n");
523 ok(
ret,
"Failed to get vport origin\n");
524 ok(
org.x == 0 &&
org.y == 0,
"Unexpected vport origin\n");
527 ok(
ret,
"Failed to get vport origin\n");
528 ok(
org.x ==
rect->left &&
org.y ==
rect->top,
"Unexpected window origin\n");
531 ok(
ret,
"Failed to get clip box\n");
532 ok(
box.left ==
rect->left &&
box.top ==
rect->top,
"Unexpected clip box\n");
540 BP_PAINTPARAMS
params = { 0 };
549 if (!pBeginBufferedPaint)
551 win_skip(
"Buffered painting API is not supported.\n");
569 src = (
void *)0xdeadbeef;
577 src = (
void *)0xdeadbeef;
585 src = (
void *)0xdeadbeef;
592 src = (
void *)0xdeadbeef;
600 src = (
void *)0xdeadbeef;
611 ok(
src !=
NULL,
"Expected buffered dc\n");
613 ok(
hr ==
S_OK,
"Unexpected return code %#x\n",
hr);
627 ok(
hr ==
S_OK,
"Unexpected return code %#x\n",
hr);
647 ok(
hr ==
S_OK,
"Unexpected return code %#x\n",
hr);
651 ok(
hr ==
S_OK,
"Unexpected return code %#x\n",
hr);
657 hdc = pGetBufferedPaintDC(
NULL);
660 hdc = pGetBufferedPaintTargetDC(
NULL);
669 bits = (
void *)0xdeadbeef;
673 ok(
row == 10,
"Unexpected row count %d\n",
row);
674 ok(
bits == (
void *)0xdeadbeef,
"Unexpected data pointer %p\n",
bits);
685 screen_dc =
GetDC(0);
688 ok(
hdc !=
NULL,
"Failed to create a DC\n");
690 ok(
hbm !=
NULL,
"Failed to create a bitmap\n");
700 ok(
hr ==
S_OK,
"Unexpected return code %#x\n",
hr);
708 ok(
hr ==
S_OK,
"Unexpected return code %#x\n",
hr);
723 ok(
hr ==
S_OK,
"Unexpected return code %#x\n",
hr);
729 ok(
hr ==
S_OK,
"Unexpected return code %#x\n",
hr);
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
static const RECT BP_BUFFERFORMAT
HDC WINAPI GetDC(_In_opt_ HWND)
static const RECT BP_PAINTPARAMS HDC *static HRESULT(WINAPI *pBufferedPaintClear)(HPAINTBUFFER
BOOL WINAPI GetWindowOrgEx(_In_ HDC, _Out_ LPPOINT)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
static void test_GetCurrentThemeName(void)
BOOL WINAPI IsThemePartDefined(HTHEME hTheme, int iPartId, int iStateId)
HRESULT WINAPI EndBufferedPaint(HPAINTBUFFER hPaintBuffer, BOOL fUpdateTarget)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
#define INVALID_HANDLE_VALUE
static HTHEME(WINAPI *pOpenThemeDataEx)(HWND
DWORD WINAPI GetLastError(VOID)
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
static HPAINTBUFFER(WINAPI *pBeginBufferedPaint)(HDC
BOOL WINAPI DestroyWindow(_In_ HWND)
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
#define UXTHEME_GET_PROC(func)
HRESULT WINAPI SetWindowTheme(HWND hwnd, LPCWSTR pszSubAppName, LPCWSTR pszSubIdList)
HDC WINAPI GetBufferedPaintTargetDC(HPAINTBUFFER hBufferedPaint)
HRESULT WINAPI GetBufferedPaintTargetRect(HPAINTBUFFER hBufferedPaint, RECT *prc)
GLenum const GLfloat * params
HRESULT WINAPI BufferedPaintClear(HPAINTBUFFER hBufferedPaint, const RECT *prc)
BOOL WINAPI IsAppThemed(void)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
static void test_IsThemed(void)
static void test_SetWindowTheme(void)
static void test_buffered_paint(void)
HRESULT WINAPI GetBufferedPaintBits(HPAINTBUFFER hBufferedPaint, RGBQUAD **ppbBuffer, int *pcxRow)
int __cdecl system(_In_opt_z_ const char *_Command)
static RGBQUAD int *static HDC(WINAPI *pGetBufferedPaintDC)(HPAINTBUFFER)
_In_ ULONG _In_ ULONG_PTR ident
BOOL WINAPI GetWorldTransform(_In_ HDC, _Out_ LPXFORM)
#define E_PROP_ID_UNSUPPORTED
static void test_OpenThemeDataEx(void)
int WINAPI GetGraphicsMode(_In_ HDC)
HTHEME WINAPI OpenThemeDataEx(HWND hwnd, LPCWSTR pszClassList, DWORD flags)
BOOL WINAPI GetViewportOrgEx(_In_ HDC, _Out_ LPPOINT)
int WINAPI GetClipBox(_In_ HDC, _Out_ LPRECT)
HDC WINAPI GetBufferedPaintDC(HPAINTBUFFER hBufferedPaint)
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist)
HTHEME WINAPI GetWindowTheme(HWND hwnd)
static void test_CloseThemeData(void)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
#define E_NOT_SUFFICIENT_BUFFER
static void test_OpenThemeData(void)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
HRESULT WINAPI GetCurrentThemeName(LPWSTR pszThemeFileName, int dwMaxNameChars, LPWSTR pszColorBuff, int cchMaxColorChars, LPWSTR pszSizeBuff, int cchMaxSizeChars)
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)
BOOL WINAPI DeleteDC(_In_ HDC)
static void test_GetWindowTheme(void)
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI IsThemeActive(void)
#define BPBF_COMPATIBLEBITMAP
static const RECT BP_PAINTPARAMS HDC *static const RECT *static BOOL
static RECT *static void init_funcs(void)
static void test_buffer_dc_props(HDC hdc, const RECT *rect)
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
HPAINTBUFFER WINAPI BeginBufferedPaint(HDC hdcTarget, const RECT *prcTarget, BP_BUFFERFORMAT dwFormat, BP_PAINTPARAMS *pPaintParams, HDC *phdc)
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row