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