ReactOS  0.4.12-dev-102-g4b7f1e0
uxthemesupp.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Applications
3  * LICENSE: LGPL - See COPYING in the top level directory
4  * FILE: base/applications/msconfig_new/comctl32ex/uxthemesupp.c
5  * PURPOSE: UX Theming helpers.
6  * COPYRIGHT: Copyright 2015 Hermes BELUSCA - MAITO <hermes.belusca@sfr.fr>
7  */
8 
9 #include "precomp.h"
10 #include "uxthemesupp.h"
11 
13 
16 
19 
20 
21 static BOOL
23 {
24  if (hUxTheme) return TRUE;
25 
26  hUxTheme = LoadLibraryW(L"uxtheme.dll");
27  if (hUxTheme == NULL) return FALSE;
28 
30  (ETDTProc)GetProcAddress(hUxTheme, "EnableThemeDialogTexture");
32  (SWTProc)GetProcAddress(hUxTheme, "SetWindowTheme");
33 
34  return TRUE;
35 }
36 
37 #if 0
38 static VOID
39 CleanupUxTheme(VOID)
40 {
41  FreeLibrary(hUxTheme);
42  hUxTheme = NULL;
43 }
44 #endif
45 
46 
48 // Taken from WinSpy++ 1.7
49 // http://www.catch22.net/software/winspy
50 // Copyright (c) 2002 by J Brown
51 //
52 
53 HRESULT
54 WINAPI
57 {
58  if (!InitUxTheme())
60 
63 
64  return fnEnableThemeDialogTexture(hwnd, dwFlags);
65 }
66 
67 HRESULT
68 WINAPI
70  _In_ LPCWSTR pszSubAppName,
71  _In_ LPCWSTR pszSubIdList)
72 {
73  if (!InitUxTheme())
75 
76  if (!fnSetWindowTheme)
78 
79  return fnSetWindowTheme(hwnd, pszSubAppName, pszSubIdList);
80 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static HMODULE hUxTheme
Definition: uxthemesupp.c:12
#define TRUE
Definition: types.h:120
HRESULT(WINAPI * ETDTProc)(HWND, DWORD)
Definition: uxthemesupp.c:14
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define DWORD
Definition: msvc.h:34
HANDLE HWND
Definition: compat.h:13
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
HRESULT WINAPI SetWindowTheme(_In_ HWND hwnd, _In_ LPCWSTR pszSubAppName, _In_ LPCWSTR pszSubIdList)
Definition: uxthemesupp.c:69
#define LoadLibraryW(x)
Definition: compat.h:404
smooth NULL
Definition: ftsmooth.c:416
#define FreeLibrary(x)
Definition: compat.h:405
unsigned int BOOL
Definition: ntddk_ex.h:94
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI EnableThemeDialogTexture(_In_ HWND hwnd, _In_ DWORD dwFlags)
Definition: uxthemesupp.c:55
static ETDTProc fnEnableThemeDialogTexture
Definition: uxthemesupp.c:15
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1087
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
HRESULT(WINAPI * SWTProc)(HWND, LPCWSTR, LPCWSTR)
Definition: uxthemesupp.c:17
#define WINAPI
Definition: msvc.h:20
#define _In_
Definition: no_sal2.h:204
static BOOL InitUxTheme(VOID)
Definition: uxthemesupp.c:22
#define HRESULT
Definition: msvc.h:21
#define GetProcAddress(x, y)
Definition: compat.h:410
static SWTProc fnSetWindowTheme
Definition: uxthemesupp.c:18
#define LPCWSTR
Definition: msvc.h:45