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>
10 #include "uxthemesupp.h"
12 static HMODULE hUxTheme
= NULL
;
14 typedef HRESULT (WINAPI
* ETDTProc
)(HWND
, DWORD
);
15 static ETDTProc fnEnableThemeDialogTexture
= NULL
;
17 typedef HRESULT (WINAPI
* SWTProc
)(HWND
, LPCWSTR
, LPCWSTR
);
18 static SWTProc fnSetWindowTheme
= NULL
;
24 if (hUxTheme
) return TRUE
;
26 hUxTheme
= LoadLibraryW(L
"uxtheme.dll");
27 if (hUxTheme
== NULL
) return FALSE
;
29 fnEnableThemeDialogTexture
=
30 (ETDTProc
)GetProcAddress(hUxTheme
, "EnableThemeDialogTexture");
32 (SWTProc
)GetProcAddress(hUxTheme
, "SetWindowTheme");
41 FreeLibrary(hUxTheme
);
47 ////////////////////////////////////////////////////////////////////////////////
48 // Taken from WinSpy++ 1.7
49 // http://www.catch22.net/software/winspy
50 // Copyright (c) 2002 by J Brown
55 EnableThemeDialogTexture(_In_ HWND hwnd
,
59 return HRESULT_FROM_WIN32(GetLastError());
61 if (!fnEnableThemeDialogTexture
)
62 return HRESULT_FROM_WIN32(GetLastError());
64 return fnEnableThemeDialogTexture(hwnd
, dwFlags
);
69 SetWindowTheme(_In_ HWND hwnd
,
70 _In_ LPCWSTR pszSubAppName
,
71 _In_ LPCWSTR pszSubIdList
)
74 return HRESULT_FROM_WIN32(GetLastError());
76 if (!fnSetWindowTheme
)
77 return HRESULT_FROM_WIN32(GetLastError());
79 return fnSetWindowTheme(hwnd
, pszSubAppName
, pszSubIdList
);