mirror of
https://github.com/reactos/wine.git
synced 2024-11-28 22:20:26 +00:00
uxtheme/tests: Add some tests for GetWindowTheme.
This commit is contained in:
parent
b865c07db9
commit
36a775d0c7
@ -26,6 +26,7 @@
|
||||
#include "wine/test.h"
|
||||
|
||||
static HRESULT (WINAPI * pCloseThemeData)(HTHEME);
|
||||
static HTHEME (WINAPI * pGetWindowTheme)(HWND);
|
||||
static BOOL (WINAPI * pIsAppThemed)(VOID);
|
||||
static BOOL (WINAPI * pIsThemeActive)(VOID);
|
||||
static HTHEME (WINAPI * pOpenThemeData)(HWND, LPCWSTR);
|
||||
@ -51,6 +52,7 @@ static BOOL InitFunctionPtrs(void)
|
||||
if (hUxtheme)
|
||||
{
|
||||
UXTHEME_GET_PROC(CloseThemeData)
|
||||
UXTHEME_GET_PROC(GetWindowTheme)
|
||||
UXTHEME_GET_PROC(IsAppThemed)
|
||||
UXTHEME_GET_PROC(IsThemeActive)
|
||||
UXTHEME_GET_PROC(OpenThemeData)
|
||||
@ -89,6 +91,31 @@ static void test_IsThemed(void)
|
||||
GetLastError());
|
||||
}
|
||||
|
||||
static void test_GetWindowTheme(void)
|
||||
{
|
||||
HTHEME hTheme;
|
||||
HWND hWnd;
|
||||
|
||||
SetLastError(0xdeadbeef);
|
||||
hTheme = pGetWindowTheme(NULL);
|
||||
ok( hTheme == NULL, "Expected a NULL return, got %p\n", hTheme);
|
||||
todo_wine
|
||||
ok( GetLastError() == E_HANDLE,
|
||||
"Expected E_HANDLE, got 0x%08lx\n",
|
||||
GetLastError());
|
||||
|
||||
/* Only do the bare minumum to get a valid hwnd */
|
||||
hWnd = CreateWindowExA(0, "static", "", WS_POPUP, 0,0,100,100,0, 0, 0, NULL);
|
||||
if (!hWnd) return;
|
||||
|
||||
SetLastError(0xdeadbeef);
|
||||
hTheme = pGetWindowTheme(hWnd);
|
||||
ok( hTheme == NULL, "Expected a NULL return, got %p\n", hTheme);
|
||||
ok( GetLastError() == 0xdeadbeef,
|
||||
"Expected 0xdeadbeef, got 0x%08lx\n",
|
||||
GetLastError());
|
||||
}
|
||||
|
||||
static void test_SetWindowTheme(void)
|
||||
{
|
||||
HRESULT hRes;
|
||||
@ -244,6 +271,11 @@ START_TEST(system)
|
||||
if (pIsAppThemed && pIsThemeActive)
|
||||
test_IsThemed();
|
||||
|
||||
/* GetWindowTheme */
|
||||
trace("Starting test_GetWindowTheme()\n");
|
||||
if (pGetWindowTheme)
|
||||
test_GetWindowTheme();
|
||||
|
||||
/* SetWindowTheme */
|
||||
trace("Starting test_SetWindowTheme()\n");
|
||||
if (pSetWindowTheme)
|
||||
|
Loading…
Reference in New Issue
Block a user