ReactOS  0.4.14-dev-50-g13bb5e2
SetThemeAppProperties.c File Reference
#include <apitest.h>
#include <stdio.h>
#include <windows.h>
#include <uxtheme.h>
#include <vfwmsgs.h>
Include dependency graph for SetThemeAppProperties.c:

Go to the source code of this file.

Functions

 START_TEST (SetThemeAppProperties)
 

Function Documentation

◆ START_TEST()

START_TEST ( SetThemeAppProperties  )

Definition at line 14 of file SetThemeAppProperties.c.

15 {
17  HTHEME hTheme;
18  HWND hWnd;
19 
21  if (!bThemeActive)
22  {
23  skip("No active theme, skipping SetWindowTheme tests\n");
24  return;
25  }
26 
27  SetLastError(0xdeadbeef);
28 
30  ok (bThemeActive == FALSE, "\n");
31  ok( GetLastError() == 0, "Expected 0 last error, got 0x%lx\n", GetLastError());
32 
33  SetLastError(0xdeadbeef);
34  hTheme = OpenThemeData(NULL, L"BUTTON");
35  ok (hTheme == NULL, "\n");
36  ok( GetLastError() == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED last error, got 0x%lx\n", GetLastError());
37 
38  hWnd = CreateWindowExA(0, "static", "", WS_POPUP, 0,0,100,100,0, 0, 0, NULL);
39  ok (hWnd != NULL, "\n");
40 
41  SetLastError(0xdeadbeef);
43  ok (bThemeActive == TRUE, "\n");
44  ok( GetLastError() == 0, "Expected 0 last error, got 0x%lx\n", GetLastError());
45 
46  SetLastError(0xdeadbeef);
47  hTheme = OpenThemeData(NULL, L"BUTTON");
48  ok (hTheme != NULL, "\n");
49  ok( GetLastError() == 0, "Expected 0 last error, got 0x%lx\n", GetLastError());
50 
51  SetLastError(0xdeadbeef);
53  ok( GetLastError() == 0, "Expected 0 last error, got 0x%lx\n", GetLastError());
54 
56  ok (bThemeActive == TRUE, "\n");
57 
59  ok (bThemeActive == TRUE, "\n");
60 
61  SetLastError(0xdeadbeef);
62  hTheme = OpenThemeData(NULL, L"BUTTON");
63  ok (hTheme == NULL, "\n");
64  ok( GetLastError() == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED last error, got 0x%lx\n", GetLastError());
65 
66  SetThemeAppProperties(STAP_ALLOW_NONCLIENT);
67 
68  hTheme = OpenThemeDataEx (NULL, L"BUTTON", OTD_NONCLIENT);
69  ok (hTheme != NULL, "\n");
70  SetLastError(0xdeadbeef);
71  hTheme = OpenThemeDataEx (NULL, L"BUTTON", 0);
72  ok (hTheme == NULL, "\n");
73  ok( GetLastError() == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED last error, got 0x%lx\n", GetLastError());
74 
75  SetThemeAppProperties(STAP_ALLOW_CONTROLS);
76 
77  SetLastError(0xdeadbeef);
78  hTheme = OpenThemeDataEx (NULL, L"BUTTON", OTD_NONCLIENT);
79  ok (hTheme == NULL, "\n");
80  ok( GetLastError() == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED last error, got 0x%lx\n", GetLastError());
81  hTheme = OpenThemeDataEx (NULL, L"BUTTON", 0);
82  ok (hTheme != NULL, "\n");
83 
84 }
#define TRUE
Definition: types.h:120
HWND hWnd
Definition: settings.c:17
static HTHEME(WINAPI *pOpenThemeDataEx)(HWND
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI IsAppThemed(void)
Definition: system.c:596
void WINAPI SetThemeAppProperties(DWORD dwFlags)
Definition: system.c:941
smooth NULL
Definition: ftsmooth.c:416
#define E_PROP_ID_UNSUPPORTED
Definition: vfwmsgs.h:173
HTHEME WINAPI OpenThemeDataEx(HWND hwnd, LPCWSTR pszClassList, DWORD flags)
Definition: system.c:819
#define SetLastError(x)
Definition: compat.h:409
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist)
Definition: system.c:835
static const WCHAR L[]
Definition: oid.c:1250
#define ok(value,...)
Definition: atltest.h:57
#define WS_POPUP
Definition: pedump.c:616
#define skip(...)
Definition: atltest.h:64
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)
Definition: system.c:606
static BOOL bThemeActive
Definition: scroll.c:29