OSDN Git Service

Change Dir Structure to be same as TortoiseSVN'
[tortoisegit/TortoiseGitJp.git] / src / Utils / MiscUI / XPTheme.h
1 #ifndef _THEME_H_\r
2 #define _THEME_H_\r
3 \r
4 #pragma once\r
5 \r
6 #include <uxtheme.h>\r
7 #include <tmschema.h>\r
8 \r
9 #ifndef WM_THEMECHANGED\r
10 #define WM_THEMECHANGED                 0x031A\r
11 #endif\r
12 \r
13 #pragma warning(push)\r
14 #pragma warning(disable : 4100)\r
15 \r
16 class CXPTheme\r
17 {\r
18 private:\r
19         HTHEME m_hTheme;\r
20 \r
21         static HMODULE m_hThemeDll;\r
22         static BOOL m_bLoaded;\r
23 \r
24         static void* GetProc(LPCSTR szProc, void* pfnFail);\r
25 \r
26         typedef HTHEME(__stdcall *PFNOPENTHEMEDATA)(HWND hwnd, LPCWSTR pszClassList);\r
27         static HTHEME __stdcall OpenThemeDataFail(HWND , LPCWSTR )\r
28         {return NULL;}\r
29         static PFNOPENTHEMEDATA m_pOpenThemeData;\r
30 \r
31         typedef HRESULT(__stdcall *PFNCLOSETHEMEDATA)(HTHEME hTheme);\r
32         static HRESULT __stdcall CloseThemeDataFail(HTHEME)\r
33         {return E_FAIL;}\r
34         static PFNCLOSETHEMEDATA m_pCloseThemeData;\r
35 \r
36         typedef HRESULT(__stdcall *PFNDRAWTHEMEBACKGROUND)(HTHEME hTheme, HDC hdc, \r
37                 int iPartId, int iStateId, const RECT *pRect,  const RECT *pClipRect);\r
38         static HRESULT __stdcall DrawThemeBackgroundFail(HTHEME, HDC, int, int, const RECT *, const RECT *)\r
39         {return E_FAIL;}\r
40         static PFNDRAWTHEMEBACKGROUND m_pDrawThemeBackground;\r
41 \r
42         typedef HRESULT (__stdcall *PFNDRAWTHEMETEXT)(HTHEME hTheme, HDC hdc, int iPartId, \r
43                 int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, \r
44                 DWORD dwTextFlags2, const RECT *pRect);\r
45         static HRESULT __stdcall DrawThemeTextFail(HTHEME, HDC, int, int, LPCWSTR, int, DWORD, DWORD, const RECT*)\r
46         {return E_FAIL;}\r
47         static PFNDRAWTHEMETEXT m_pDrawThemeText;\r
48 \r
49         typedef HRESULT (__stdcall *PFNGETTHEMEBACKGROUNDCONTENTRECT)(HTHEME hTheme,  HDC hdc, \r
50                 int iPartId, int iStateId,  const RECT *pBoundingRect, \r
51                 RECT *pContentRect);\r
52         static HRESULT __stdcall GetThemeBackgroundContentRectFail(HTHEME hTheme,  HDC hdc, \r
53                 int iPartId, int iStateId,  const RECT *pBoundingRect, \r
54                 RECT *pContentRect)\r
55         {return E_FAIL;}\r
56         static PFNGETTHEMEBACKGROUNDCONTENTRECT m_pGetThemeBackgroundContentRect;\r
57 \r
58         typedef HRESULT (__stdcall *PFNGETTHEMEBACKGROUNDEXTENT)(HTHEME hTheme,  HDC hdc,\r
59                 int iPartId, int iStateId, const RECT *pContentRect, \r
60                 RECT *pExtentRect);\r
61         static HRESULT __stdcall GetThemeBackgroundExtentFail(HTHEME hTheme,  HDC hdc,\r
62                 int iPartId, int iStateId, const RECT *pContentRect, \r
63                 RECT *pExtentRect)\r
64         {return E_FAIL;}\r
65         static PFNGETTHEMEBACKGROUNDEXTENT m_pGetThemeBackgroundExtent;\r
66 \r
67         typedef HRESULT(__stdcall *PFNGETTHEMEPARTSIZE)(HTHEME hTheme, HDC hdc, \r
68                 int iPartId, int iStateId, RECT * pRect, enum THEMESIZE eSize,  SIZE *psz);\r
69         static HRESULT __stdcall GetThemePartSizeFail(HTHEME, HDC, int, int, RECT *, enum THEMESIZE, SIZE *)\r
70         {return E_FAIL;}\r
71         static PFNGETTHEMEPARTSIZE m_pGetThemePartSize;\r
72 \r
73         typedef HRESULT (__stdcall *PFNGETTHEMETEXTEXTENT)(HTHEME hTheme, HDC hdc, \r
74                 int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, \r
75                 DWORD dwTextFlags,  const RECT *pBoundingRect, \r
76                 RECT *pExtentRect);\r
77         static HRESULT __stdcall GetThemeTextExtentFail(HTHEME hTheme, HDC hdc, \r
78                 int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, \r
79                 DWORD dwTextFlags,  const RECT *pBoundingRect, \r
80                 RECT *pExtentRect)\r
81         {return E_FAIL;}\r
82         static PFNGETTHEMETEXTEXTENT m_pGetThemeTextExtent;\r
83 \r
84         typedef HRESULT (__stdcall *PFNGETTHEMETEXTMETRICS)(HTHEME hTheme,  HDC hdc, \r
85                 int iPartId, int iStateId,  TEXTMETRIC* ptm);\r
86         static HRESULT __stdcall GetThemeTextMetricsFail(HTHEME hTheme,  HDC hdc, \r
87                 int iPartId, int iStateId,  TEXTMETRIC* ptm)\r
88         {return E_FAIL;}\r
89         static PFNGETTHEMETEXTMETRICS m_pGetThemeTextMetrics;\r
90 \r
91         typedef HRESULT (__stdcall *PFNGETTHEMEBACKGROUNDREGION)(HTHEME hTheme,  HDC hdc,  \r
92                 int iPartId, int iStateId, const RECT *pRect,  HRGN *pRegion);\r
93         static HRESULT __stdcall GetThemeBackgroundRegionFail(HTHEME hTheme,  HDC hdc,  \r
94                 int iPartId, int iStateId, const RECT *pRect,  HRGN *pRegion)\r
95         {return E_FAIL;}\r
96         static PFNGETTHEMEBACKGROUNDREGION m_pGetThemeBackgroundRegion;\r
97 \r
98         typedef HRESULT (__stdcall *PFNHITTESTTHEMEBACKGROUND)(HTHEME hTheme,  HDC hdc, int iPartId, \r
99                 int iStateId, DWORD dwOptions, const RECT *pRect,  HRGN hrgn, \r
100                 POINT ptTest,  WORD *pwHitTestCode);\r
101         static HRESULT __stdcall HitTestThemeBackgroundFail(HTHEME hTheme,  HDC hdc, int iPartId, \r
102                 int iStateId, DWORD dwOptions, const RECT *pRect,  HRGN hrgn, \r
103                 POINT ptTest,  WORD *pwHitTestCode)\r
104         {return E_FAIL;}\r
105         static PFNHITTESTTHEMEBACKGROUND m_pHitTestThemeBackground;\r
106 \r
107         typedef HRESULT (__stdcall *PFNDRAWTHEMEEDGE)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, \r
108                 const RECT *pDestRect, UINT uEdge, UINT uFlags,   RECT *pContentRect);\r
109         static HRESULT __stdcall DrawThemeEdgeFail(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, \r
110                 const RECT *pDestRect, UINT uEdge, UINT uFlags,   RECT *pContentRect)\r
111         {return E_FAIL;}\r
112         static PFNDRAWTHEMEEDGE m_pDrawThemeEdge;\r
113 \r
114         typedef HRESULT (__stdcall *PFNDRAWTHEMEICON)(HTHEME hTheme, HDC hdc, int iPartId, \r
115                 int iStateId, const RECT *pRect, HIMAGELIST himl, int iImageIndex);\r
116         static HRESULT __stdcall DrawThemeIconFail(HTHEME hTheme, HDC hdc, int iPartId, \r
117                 int iStateId, const RECT *pRect, HIMAGELIST himl, int iImageIndex)\r
118         {return E_FAIL;}\r
119         static PFNDRAWTHEMEICON m_pDrawThemeIcon;\r
120 \r
121         typedef BOOL (__stdcall *PFNISTHEMEPARTDEFINED)(HTHEME hTheme, int iPartId, \r
122                 int iStateId);\r
123         static BOOL __stdcall IsThemePartDefinedFail(HTHEME hTheme, int iPartId, \r
124                 int iStateId)\r
125         {return FALSE;}\r
126         static PFNISTHEMEPARTDEFINED m_pIsThemePartDefined;\r
127 \r
128         typedef BOOL (__stdcall *PFNISTHEMEBACKGROUNDPARTIALLYTRANSPARENT)(HTHEME hTheme, \r
129                 int iPartId, int iStateId);\r
130         static BOOL __stdcall IsThemeBackgroundPartiallyTransparentFail(HTHEME hTheme, \r
131                 int iPartId, int iStateId)\r
132         {return FALSE;}\r
133         static PFNISTHEMEBACKGROUNDPARTIALLYTRANSPARENT m_pIsThemeBackgroundPartiallyTransparent;\r
134 \r
135         typedef HRESULT (__stdcall *PFNGETTHEMECOLOR)(HTHEME hTheme, int iPartId, \r
136                 int iStateId, int iPropId,  COLORREF *pColor);\r
137         static HRESULT __stdcall GetThemeColorFail(HTHEME hTheme, int iPartId, \r
138                 int iStateId, int iPropId,  COLORREF *pColor)\r
139         {return E_FAIL;}\r
140         static PFNGETTHEMECOLOR m_pGetThemeColor;\r
141 \r
142         typedef HRESULT (__stdcall *PFNGETTHEMEMETRIC)(HTHEME hTheme,  HDC hdc, int iPartId, \r
143                 int iStateId, int iPropId,  int *piVal);\r
144         static HRESULT __stdcall GetThemeMetricFail(HTHEME hTheme,  HDC hdc, int iPartId, \r
145                 int iStateId, int iPropId,  int *piVal)\r
146         {return E_FAIL;}\r
147         static PFNGETTHEMEMETRIC m_pGetThemeMetric;\r
148 \r
149         typedef HRESULT (__stdcall *PFNGETTHEMESTRING)(HTHEME hTheme, int iPartId, \r
150                 int iStateId, int iPropId,  LPWSTR pszBuff, int cchMaxBuffChars);\r
151         static HRESULT __stdcall GetThemeStringFail(HTHEME hTheme, int iPartId, \r
152                 int iStateId, int iPropId,  LPWSTR pszBuff, int cchMaxBuffChars)\r
153         {return E_FAIL;}\r
154         static PFNGETTHEMESTRING m_pGetThemeString;\r
155 \r
156         typedef HRESULT (__stdcall *PFNGETTHEMEBOOL)(HTHEME hTheme, int iPartId, \r
157                 int iStateId, int iPropId,  BOOL *pfVal);\r
158         static HRESULT __stdcall GetThemeBoolFail(HTHEME hTheme, int iPartId, \r
159                 int iStateId, int iPropId,  BOOL *pfVal)\r
160         {return E_FAIL;}\r
161         static PFNGETTHEMEBOOL m_pGetThemeBool;\r
162 \r
163         typedef HRESULT (__stdcall *PFNGETTHEMEINT)(HTHEME hTheme, int iPartId, \r
164                 int iStateId, int iPropId,  int *piVal);\r
165         static HRESULT __stdcall GetThemeIntFail(HTHEME hTheme, int iPartId, \r
166                 int iStateId, int iPropId,  int *piVal)\r
167         {return E_FAIL;}\r
168         static PFNGETTHEMEINT m_pGetThemeInt;\r
169 \r
170         typedef HRESULT (__stdcall *PFNGETTHEMEENUMVALUE)(HTHEME hTheme, int iPartId, \r
171                 int iStateId, int iPropId,  int *piVal);\r
172         static HRESULT __stdcall GetThemeEnumValueFail(HTHEME hTheme, int iPartId, \r
173                 int iStateId, int iPropId,  int *piVal)\r
174         {return E_FAIL;}\r
175         static PFNGETTHEMEENUMVALUE m_pGetThemeEnumValue;\r
176 \r
177         typedef HRESULT (__stdcall *PFNGETTHEMEPOSITION)(HTHEME hTheme, int iPartId, \r
178                 int iStateId, int iPropId,  POINT *pPoint);\r
179         static HRESULT __stdcall GetThemePositionFail(HTHEME hTheme, int iPartId, \r
180                 int iStateId, int iPropId,  POINT *pPoint)\r
181         {return E_FAIL;}\r
182         static PFNGETTHEMEPOSITION m_pGetThemePosition;\r
183 \r
184         typedef HRESULT (__stdcall *PFNGETTHEMEFONT)(HTHEME hTheme,  HDC hdc, int iPartId, \r
185                 int iStateId, int iPropId,  LOGFONT *pFont);\r
186         static HRESULT __stdcall GetThemeFontFail(HTHEME hTheme,  HDC hdc, int iPartId, \r
187                 int iStateId, int iPropId,  LOGFONT *pFont)\r
188         {return E_FAIL;}\r
189         static PFNGETTHEMEFONT m_pGetThemeFont;\r
190 \r
191         typedef HRESULT (__stdcall *PFNGETTHEMERECT)(HTHEME hTheme, int iPartId, \r
192                 int iStateId, int iPropId,  RECT *pRect);\r
193         static HRESULT __stdcall GetThemeRectFail(HTHEME hTheme, int iPartId, \r
194                 int iStateId, int iPropId,  RECT *pRect)\r
195         {return E_FAIL;}\r
196         static PFNGETTHEMERECT m_pGetThemeRect;\r
197 \r
198         typedef HRESULT (__stdcall *PFNGETTHEMEMARGINS)(HTHEME hTheme,  HDC hdc, int iPartId, \r
199                 int iStateId, int iPropId,  RECT *prc,  MARGINS *pMargins);\r
200         static HRESULT __stdcall GetThemeMarginsFail(HTHEME hTheme,  HDC hdc, int iPartId, \r
201                 int iStateId, int iPropId,  RECT *prc,  MARGINS *pMargins)\r
202         {return E_FAIL;}\r
203         static PFNGETTHEMEMARGINS m_pGetThemeMargins;\r
204 \r
205         typedef HRESULT (__stdcall *PFNGETTHEMEINTLIST)(HTHEME hTheme, int iPartId, \r
206                 int iStateId, int iPropId,  INTLIST *pIntList);\r
207         static HRESULT __stdcall GetThemeIntListFail(HTHEME hTheme, int iPartId, \r
208                 int iStateId, int iPropId,  INTLIST *pIntList)\r
209         {return E_FAIL;}\r
210         static PFNGETTHEMEINTLIST m_pGetThemeIntList;\r
211 \r
212         typedef HRESULT (__stdcall *PFNGETTHEMEPROPERTYORIGIN)(HTHEME hTheme, int iPartId, \r
213                 int iStateId, int iPropId,  enum PROPERTYORIGIN *pOrigin);\r
214         static HRESULT __stdcall GetThemePropertyOriginFail(HTHEME hTheme, int iPartId, \r
215                 int iStateId, int iPropId,  enum PROPERTYORIGIN *pOrigin)\r
216         {return E_FAIL;}\r
217         static PFNGETTHEMEPROPERTYORIGIN m_pGetThemePropertyOrigin;\r
218 \r
219         typedef HRESULT (__stdcall *PFNSETWINDOWTHEME)(HWND hwnd, LPCWSTR pszSubAppName, \r
220                 LPCWSTR pszSubIdList);\r
221         static HRESULT __stdcall SetWindowThemeFail(HWND hwnd, LPCWSTR pszSubAppName, \r
222                 LPCWSTR pszSubIdList)\r
223         {return E_FAIL;}\r
224         static PFNSETWINDOWTHEME m_pSetWindowTheme;\r
225 \r
226         typedef HRESULT (__stdcall *PFNGETTHEMEFILENAME)(HTHEME hTheme, int iPartId, \r
227                 int iStateId, int iPropId,  LPWSTR pszThemeFileName, int cchMaxBuffChars);\r
228         static HRESULT __stdcall GetThemeFilenameFail(HTHEME hTheme, int iPartId, \r
229                 int iStateId, int iPropId,  LPWSTR pszThemeFileName, int cchMaxBuffChars)\r
230         {return E_FAIL;}\r
231         static PFNGETTHEMEFILENAME m_pGetThemeFilename;\r
232 \r
233         typedef COLORREF (__stdcall *PFNGETTHEMESYSCOLOR)(HTHEME hTheme, int iColorId);\r
234         static COLORREF __stdcall GetThemeSysColorFail(HTHEME hTheme, int iColorId)\r
235         {return RGB(255,255,255);}\r
236         static PFNGETTHEMESYSCOLOR m_pGetThemeSysColor;\r
237 \r
238         typedef HBRUSH (__stdcall *PFNGETTHEMESYSCOLORBRUSH)(HTHEME hTheme, int iColorId);\r
239         static HBRUSH __stdcall GetThemeSysColorBrushFail(HTHEME hTheme, int iColorId)\r
240         {return NULL;}\r
241         static PFNGETTHEMESYSCOLORBRUSH m_pGetThemeSysColorBrush;\r
242 \r
243         typedef BOOL (__stdcall *PFNGETTHEMESYSBOOL)(HTHEME hTheme, int iBoolId);\r
244         static BOOL __stdcall GetThemeSysBoolFail(HTHEME hTheme, int iBoolId)\r
245         {return FALSE;}\r
246         static PFNGETTHEMESYSBOOL m_pGetThemeSysBool;\r
247 \r
248         typedef int (__stdcall *PFNGETTHEMESYSSIZE)(HTHEME hTheme, int iSizeId);\r
249         static int __stdcall GetThemeSysSizeFail(HTHEME hTheme, int iSizeId)\r
250         {return 0;}\r
251         static PFNGETTHEMESYSSIZE m_pGetThemeSysSize;\r
252 \r
253         typedef HRESULT (__stdcall *PFNGETTHEMESYSFONT)(HTHEME hTheme, int iFontId,  LOGFONT *plf);\r
254         static HRESULT __stdcall GetThemeSysFontFail(HTHEME hTheme, int iFontId,  LOGFONT *plf)\r
255         {return E_FAIL;}\r
256         static PFNGETTHEMESYSFONT m_pGetThemeSysFont;\r
257 \r
258         typedef HRESULT (__stdcall *PFNGETTHEMESYSSTRING)(HTHEME hTheme, int iStringId, \r
259                 LPWSTR pszStringBuff, int cchMaxStringChars);\r
260         static HRESULT __stdcall GetThemeSysStringFail(HTHEME hTheme, int iStringId, \r
261                 LPWSTR pszStringBuff, int cchMaxStringChars)\r
262         {return E_FAIL;}\r
263         static PFNGETTHEMESYSSTRING m_pGetThemeSysString;\r
264 \r
265         typedef HRESULT (__stdcall *PFNGETTHEMESYSINT)(HTHEME hTheme, int iIntId, int *piValue);\r
266         static HRESULT __stdcall GetThemeSysIntFail(HTHEME hTheme, int iIntId, int *piValue)\r
267         {return E_FAIL;}\r
268         static PFNGETTHEMESYSINT m_pGetThemeSysInt;\r
269 \r
270         typedef BOOL (__stdcall *PFNISTHEMEACTIVE)();\r
271         static BOOL __stdcall IsThemeActiveFail()\r
272         {return FALSE;}\r
273         static PFNISTHEMEACTIVE m_pIsThemeActive;\r
274 \r
275         typedef BOOL(__stdcall *PFNISAPPTHEMED)();\r
276         static BOOL __stdcall IsAppThemedFail()\r
277         {return FALSE;}\r
278         static PFNISAPPTHEMED m_pIsAppThemed;\r
279 \r
280         typedef HTHEME (__stdcall *PFNGETWINDOWTHEME)(HWND hwnd);\r
281         static HTHEME __stdcall GetWindowThemeFail(HWND hwnd)\r
282         {return NULL;}\r
283         static PFNGETWINDOWTHEME m_pGetWindowTheme;\r
284 \r
285         typedef HRESULT (__stdcall *PFNENABLETHEMEDIALOGTEXTURE)(HWND hwnd, DWORD dwFlags);\r
286         static HRESULT __stdcall EnableThemeDialogTextureFail(HWND hwnd, DWORD dwFlags)\r
287         {return E_FAIL;}\r
288         static PFNENABLETHEMEDIALOGTEXTURE m_pEnableThemeDialogTexture;\r
289 \r
290         typedef BOOL (__stdcall *PFNISTHEMEDIALOGTEXTUREENABLED)(HWND hwnd);\r
291         static BOOL __stdcall IsThemeDialogTextureEnabledFail(HWND hwnd)\r
292         {return FALSE;}\r
293         static PFNISTHEMEDIALOGTEXTUREENABLED m_pIsThemeDialogTextureEnabled;\r
294 \r
295         typedef DWORD (__stdcall *PFNGETTHEMEAPPPROPERTIES)();\r
296         static DWORD __stdcall GetThemeAppPropertiesFail()\r
297         {return 0;}\r
298         static PFNGETTHEMEAPPPROPERTIES m_pGetThemeAppProperties;\r
299 \r
300         typedef void (__stdcall *PFNSETTHEMEAPPPROPERTIES)(DWORD dwFlags);\r
301         static void __stdcall SetThemeAppPropertiesFail(DWORD dwFlags)\r
302         {return;}\r
303         static PFNSETTHEMEAPPPROPERTIES m_pSetThemeAppProperties;\r
304 \r
305         typedef HRESULT (__stdcall *PFNGETCURRENTTHEMENAME)(\r
306                 LPWSTR pszThemeFileName, int cchMaxNameChars, \r
307                 LPWSTR pszColorBuff, int cchMaxColorChars,\r
308                 LPWSTR pszSizeBuff, int cchMaxSizeChars);\r
309         static HRESULT __stdcall GetCurrentThemeNameFail(\r
310                 LPWSTR pszThemeFileName, int cchMaxNameChars, \r
311                 LPWSTR pszColorBuff, int cchMaxColorChars,\r
312                 LPWSTR pszSizeBuff, int cchMaxSizeChars)\r
313         {return E_FAIL;}\r
314         static PFNGETCURRENTTHEMENAME m_pGetCurrentThemeName;\r
315 \r
316         typedef HRESULT (__stdcall *PFNGETTHEMEDOCUMENTATIONPROPERTY)(LPCWSTR pszThemeName,\r
317                 LPCWSTR pszPropertyName,  LPWSTR pszValueBuff, int cchMaxValChars);\r
318         static HRESULT __stdcall GetThemeDocumentationPropertyFail(LPCWSTR pszThemeName,\r
319                 LPCWSTR pszPropertyName,  LPWSTR pszValueBuff, int cchMaxValChars)\r
320         {return E_FAIL;}\r
321         static PFNGETTHEMEDOCUMENTATIONPROPERTY m_pGetThemeDocumentationProperty;\r
322 \r
323         typedef HRESULT (__stdcall *PFNDRAWTHEMEPARENTBACKGROUND)(HWND hwnd, HDC hdc,  RECT* prc);\r
324         static HRESULT __stdcall DrawThemeParentBackgroundFail(HWND hwnd, HDC hdc,  RECT* prc)\r
325         {return E_FAIL;}\r
326         static PFNDRAWTHEMEPARENTBACKGROUND m_pDrawThemeParentBackground;\r
327 \r
328         typedef HRESULT (__stdcall *PFNENABLETHEMING)(BOOL fEnable);\r
329         static HRESULT __stdcall EnableThemingFail(BOOL fEnable)\r
330         {return E_FAIL;}\r
331         static PFNENABLETHEMING m_pEnableTheming;\r
332 public:\r
333         BOOL Open(HWND hwnd, LPCWSTR pszClassList);\r
334         void Close();\r
335         HRESULT DrawBackground(HDC hdc, \r
336                 int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect);\r
337         HRESULT DrawText(HDC hdc, int iPartId, \r
338                 int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, \r
339                 DWORD dwTextFlags2, const RECT *pRect);\r
340         HRESULT GetBackgroundContentRect(HDC hdc, \r
341                 int iPartId, int iStateId,  const RECT *pBoundingRect, \r
342                 RECT *pContentRect);\r
343         HRESULT GetBackgroundExtent(HDC hdc,\r
344                 int iPartId, int iStateId, const RECT *pContentRect, \r
345                 RECT *pExtentRect);\r
346         HRESULT GetPartSize(HDC hdc, \r
347                 int iPartId, int iStateId, RECT * pRect, enum THEMESIZE eSize, SIZE *psz);\r
348         HRESULT GetTextExtent(HDC hdc, \r
349                 int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, \r
350                 DWORD dwTextFlags,  const RECT *pBoundingRect, \r
351                 RECT *pExtentRect);\r
352         HRESULT GetTextMetrics(HDC hdc, \r
353                 int iPartId, int iStateId,  TEXTMETRIC* ptm);\r
354         HRESULT GetBackgroundRegion(HDC hdc,  \r
355                 int iPartId, int iStateId, const RECT *pRect,  HRGN *pRegion);\r
356         HRESULT HitTestBackground(HDC hdc, int iPartId, \r
357                 int iStateId, DWORD dwOptions, const RECT *pRect,  HRGN hrgn, \r
358                 POINT ptTest,  WORD *pwHitTestCode);\r
359         HRESULT DrawEdge(HDC hdc, int iPartId, int iStateId, \r
360                 const RECT *pDestRect, UINT uEdge, UINT uFlags,   RECT *pContentRect);\r
361         HRESULT DrawIcon(HDC hdc, int iPartId, \r
362                 int iStateId, const RECT *pRect, HIMAGELIST himl, int iImageIndex);\r
363         BOOL IsPartDefined(int iPartId, \r
364                 int iStateId);\r
365         BOOL IsBackgroundPartiallyTransparent( \r
366                 int iPartId, int iStateId);\r
367         HRESULT GetColor(int iPartId, \r
368                 int iStateId, int iPropId,  COLORREF *pColor);\r
369         HRESULT GetMetric(HDC hdc, int iPartId, \r
370                 int iStateId, int iPropId,  int *piVal);\r
371         HRESULT GetString(int iPartId, \r
372                 int iStateId, int iPropId,  LPWSTR pszBuff, int cchMaxBuffChars);\r
373         HRESULT GetBool(int iPartId, \r
374                 int iStateId, int iPropId,  BOOL *pfVal);\r
375         HRESULT GetInt(int iPartId, \r
376                 int iStateId, int iPropId,  int *piVal);\r
377         HRESULT GetEnumValue(int iPartId, \r
378                 int iStateId, int iPropId,  int *piVal);\r
379         HRESULT GetPosition(int iPartId, \r
380                 int iStateId, int iPropId,  POINT *pPoint);\r
381         HRESULT GetFont(HDC hdc, int iPartId, \r
382                 int iStateId, int iPropId,  LOGFONT *pFont);\r
383         HRESULT GetRect(int iPartId, \r
384                 int iStateId, int iPropId,  RECT *pRect);\r
385         HRESULT GetMargins(HDC hdc, int iPartId, \r
386                 int iStateId, int iPropId,  RECT *prc,  MARGINS *pMargins);\r
387         HRESULT GetIntList(int iPartId, \r
388                 int iStateId, int iPropId,  INTLIST *pIntList);\r
389         HRESULT GetPropertyOrigin(int iPartId, \r
390                 int iStateId, int iPropId,  enum PROPERTYORIGIN *pOrigin);\r
391         static HRESULT SetWindowTheme(HWND hwnd, LPCWSTR pszSubAppName, \r
392                 LPCWSTR pszSubIdList);\r
393         HRESULT GetFilename(int iPartId, \r
394                 int iStateId, int iPropId,  LPWSTR pszThemeFileName, int cchMaxBuffChars);\r
395         COLORREF GetSysColor(int iColorId);\r
396         HBRUSH GetSysColorBrush(int iColorId);\r
397         BOOL GetSysBool(int iBoolId);\r
398         int GetSysSize(int iSizeId);\r
399         HRESULT GetSysFont(int iFontId,  LOGFONT *plf);\r
400         HRESULT GetSysString(int iStringId, \r
401                 LPWSTR pszStringBuff, int cchMaxStringChars);\r
402         HRESULT GetSysInt(int iIntId, int *piValue);\r
403         static BOOL IsActive();\r
404         static BOOL IsAppThemed();      \r
405         static HTHEME GetWindowTheme(HWND hwnd);\r
406         static HRESULT EnableDialogTexture(HWND hwnd, DWORD dwFlags);\r
407         static BOOL IsDialogTextureEnabled(HWND hwnd);\r
408         static DWORD GetAppProperties();\r
409         static void SetAppProperties(DWORD dwFlags);\r
410         static HRESULT GetCurrentName(\r
411                 LPWSTR pszThemeFileName, int cchMaxNameChars, \r
412                 LPWSTR pszColorBuff, int cchMaxColorChars,\r
413                 LPWSTR pszSizeBuff, int cchMaxSizeChars);\r
414         static HRESULT GetDocumentationProperty(LPCWSTR pszThemeName,\r
415                 LPCWSTR pszPropertyName,  LPWSTR pszValueBuff, int cchMaxValChars);\r
416         static HRESULT DrawParentBackground(HWND hwnd, HDC hdc,  RECT* prc);\r
417         static HRESULT EnableTheming(BOOL fEnable);\r
418 public:\r
419         CXPTheme(void);\r
420         CXPTheme(HTHEME hTheme);\r
421         CXPTheme(HWND hwnd, LPCWSTR pszClassList);\r
422         ~CXPTheme(void);\r
423         void Attach(HTHEME hTheme);\r
424         HTHEME Detach();\r
425         operator HTHEME() const;\r
426         bool operator!() const;\r
427 \r
428         static void Release(void);\r
429         static BOOL IsAvailable();\r
430 };\r
431 #pragma warning(pop)\r
432 #endif