-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathVisualStylesXP.cpp
458 lines (405 loc) · 16.5 KB
/
VisualStylesXP.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
/////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2001-2002 by David Yuheng Zhao
//
// Distribute and change freely, except: don't remove my name from the source
//
// No warrantee of any kind, express or implied, is included with this
// software; use at your own risk, responsibility for damages (if any) to
// anyone resulting from the use of this software rests entirely with the
// user.
//
// Partly based on the _ThemeHelper struct in MFC7.0 source code (winctrl3.cpp),
// and the difference is that this implementation wraps the full set of
// visual style APIs from the platform SDK August 2001
//
// If you have any questions, I can be reached as follows:
//
//
// How to use:
// Instead of calling the API directly,
// OpenThemeData(...);
// use the global variable
// g_xpStyle.OpenThemeData(...);
//
/////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "VisualStylesXP.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
CVisualStylesXP g_xpStyle;
HMODULE CVisualStylesXP::m_hThemeDll = NULL;
CVisualStylesXP::CVisualStylesXP(void)
{
m_hThemeDll = LoadLibrary(_T("UxTheme.dll"));
}
CVisualStylesXP::~CVisualStylesXP(void)
{
if (m_hThemeDll != NULL)
VERIFY( FreeLibrary(m_hThemeDll) );
m_hThemeDll = NULL;
}
void* CVisualStylesXP::GetProc(LPCSTR szProc, void* pfnFail)
{
void* pRes = pfnFail;
if (m_hThemeDll != NULL){
void* pRet = GetProcAddress(m_hThemeDll, szProc);
if (pRet != NULL)
pRes = pRet;
}
return pRes;
}
HTHEME CVisualStylesXP::OpenThemeData(HWND hwnd, LPCWSTR pszClassList)
{
static PFNOPENTHEMEDATA pfn = NULL;
if (pfn == NULL)
pfn = (PFNOPENTHEMEDATA)GetProc("OpenThemeData", (void*)OpenThemeDataFail);
return (*pfn)(hwnd, pszClassList);
}
HRESULT CVisualStylesXP::CloseThemeData(HTHEME hTheme)
{
static PFNCLOSETHEMEDATA pfn = NULL;
if (pfn == NULL)
pfn = (PFNCLOSETHEMEDATA)GetProc("CloseThemeData", (void*)CloseThemeDataFail);
return (*pfn)(hTheme);
}
HRESULT CVisualStylesXP::DrawThemeBackground(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect)
{
static PFNDRAWTHEMEBACKGROUND pfn = NULL;
if (pfn == NULL)
pfn = (PFNDRAWTHEMEBACKGROUND)GetProc("DrawThemeBackground", (void*)DrawThemeBackgroundFail);
return (*pfn)(hTheme, hdc, iPartId, iStateId, pRect, pClipRect);
}
HRESULT CVisualStylesXP::DrawThemeText(HTHEME hTheme, HDC hdc, int iPartId,
int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags,
DWORD dwTextFlags2, const RECT *pRect)
{
static PFNDRAWTHEMETEXT pfn = NULL;
if (pfn == NULL)
pfn = (PFNDRAWTHEMETEXT)GetProc("DrawThemeText", (void*)DrawThemeTextFail);
return (*pfn)(hTheme, hdc, iPartId, iStateId, pszText, iCharCount, dwTextFlags, dwTextFlags2, pRect);
}
HRESULT CVisualStylesXP::GetThemeBackgroundContentRect(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, const RECT *pBoundingRect,
RECT *pContentRect)
{
static PFNGETTHEMEBACKGROUNDCONTENTRECT pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMEBACKGROUNDCONTENTRECT)GetProc("GetThemeBackgroundContentRect", (void*)GetThemeBackgroundContentRectFail);
return (*pfn)(hTheme, hdc, iPartId, iStateId, pBoundingRect, pContentRect);
}
HRESULT CVisualStylesXP::GetThemeBackgroundExtent(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, const RECT *pContentRect,
RECT *pExtentRect)
{
static PFNGETTHEMEBACKGROUNDEXTENT pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMEBACKGROUNDEXTENT)GetProc("GetThemeBackgroundExtent", (void*)GetThemeBackgroundExtentFail);
return (*pfn)(hTheme, hdc, iPartId, iStateId, pContentRect, pExtentRect);
}
HRESULT CVisualStylesXP::GetThemePartSize(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, RECT * pRect, enum THEMESIZE eSize, SIZE *psz)
{
static PFNGETTHEMEPARTSIZE pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMEPARTSIZE)GetProc("GetThemePartSize", (void*)GetThemePartSizeFail);
return (*pfn)(hTheme, hdc, iPartId, iStateId, pRect, eSize, psz);
}
HRESULT CVisualStylesXP::GetThemeTextExtent(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, LPCWSTR pszText, int iCharCount,
DWORD dwTextFlags, const RECT *pBoundingRect, RECT *pExtentRect)
{
static PFNGETTHEMETEXTEXTENT pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMETEXTEXTENT)GetProc("GetThemeTextExtent", (void*)GetThemeTextExtentFail);
return (*pfn)(hTheme, hdc, iPartId, iStateId, pszText, iCharCount, dwTextFlags, pBoundingRect, pExtentRect);
}
HRESULT CVisualStylesXP::GetThemeTextMetrics(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, TEXTMETRIC* ptm)
{
static PFNGETTHEMETEXTMETRICS pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMETEXTMETRICS)GetProc("GetThemeTextMetrics", (void*)GetThemeTextMetricsFail);
return (*pfn)(hTheme, hdc, iPartId, iStateId, ptm);
}
HRESULT CVisualStylesXP::GetThemeBackgroundRegion(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, const RECT *pRect, HRGN *pRegion)
{
static PFNGETTHEMEBACKGROUNDREGION pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMEBACKGROUNDREGION)GetProc("GetThemeBackgroundRegion", (void*)GetThemeBackgroundRegionFail);
return (*pfn)(hTheme, hdc, iPartId, iStateId, pRect, pRegion);
}
HRESULT CVisualStylesXP::HitTestThemeBackground(HTHEME hTheme, HDC hdc, int iPartId,
int iStateId, DWORD dwOptions, const RECT *pRect, HRGN hrgn,
POINT ptTest, WORD *pwHitTestCode)
{
static PFNHITTESTTHEMEBACKGROUND pfn = NULL;
if (pfn == NULL)
pfn = (PFNHITTESTTHEMEBACKGROUND)GetProc("HitTestThemeBackground", (void*)HitTestThemeBackgroundFail);
return (*pfn)(hTheme, hdc, iPartId, iStateId, dwOptions, pRect, hrgn, ptTest, pwHitTestCode);
}
HRESULT CVisualStylesXP::DrawThemeEdge(HTHEME hTheme, HDC hdc, int iPartId, int iStateId,
const RECT *pDestRect, UINT uEdge, UINT uFlags, RECT *pContentRect)
{
static PFNDRAWTHEMEEDGE pfn = NULL;
if (pfn == NULL)
pfn = (PFNDRAWTHEMEEDGE)GetProc("DrawThemeEdge", (void*)DrawThemeEdgeFail);
return (*pfn)(hTheme, hdc, iPartId, iStateId, pDestRect, uEdge, uFlags, pContentRect);
}
HRESULT CVisualStylesXP::DrawThemeIcon(HTHEME hTheme, HDC hdc, int iPartId,
int iStateId, const RECT *pRect, HIMAGELIST himl, int iImageIndex)
{
static PFNDRAWTHEMEICON pfn = NULL;
if (pfn == NULL)
pfn = (PFNDRAWTHEMEICON)GetProc("DrawThemeIcon", (void*)DrawThemeIconFail);
return (*pfn)(hTheme, hdc, iPartId, iStateId, pRect, himl, iImageIndex);
}
BOOL CVisualStylesXP::IsThemePartDefined(HTHEME hTheme, int iPartId, int iStateId)
{
static PFNISTHEMEPARTDEFINED pfn = NULL;
if (pfn == NULL)
pfn = (PFNISTHEMEPARTDEFINED)GetProc("IsThemePartDefined", (void*)IsThemePartDefinedFail);
return (*pfn)(hTheme, iPartId, iStateId);
}
BOOL CVisualStylesXP::IsThemeBackgroundPartiallyTransparent(HTHEME hTheme, int iPartId, int iStateId)
{
static PFNISTHEMEBACKGROUNDPARTIALLYTRANSPARENT pfn = NULL;
if (pfn == NULL)
pfn = (PFNISTHEMEBACKGROUNDPARTIALLYTRANSPARENT)GetProc("IsThemeBackgroundPartiallyTransparent", (void*)IsThemeBackgroundPartiallyTransparentFail);
return (*pfn)(hTheme, iPartId, iStateId);
}
HRESULT CVisualStylesXP::GetThemeColor(HTHEME hTheme, int iPartId, int iStateId, int iPropId, COLORREF *pColor)
{
static PFNGETTHEMECOLOR pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMECOLOR)GetProc("GetThemeColor", (void*)GetThemeColorFail);
return (*pfn)(hTheme, iPartId, iStateId, iPropId, pColor);
}
HRESULT CVisualStylesXP::GetThemeMetric(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, int *piVal)
{
static PFNGETTHEMEMETRIC pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMEMETRIC)GetProc("GetThemeMetric", (void*)GetThemeMetricFail);
return (*pfn)(hTheme, hdc, iPartId, iStateId, iPropId, piVal);
}
HRESULT CVisualStylesXP::GetThemeString(HTHEME hTheme, int iPartId, int iStateId, int iPropId,
LPWSTR pszBuff, int cchMaxBuffChars)
{
static PFNGETTHEMESTRING pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMESTRING)GetProc("GetThemeString", (void*)GetThemeStringFail);
return (*pfn)(hTheme, iPartId, iStateId, iPropId, pszBuff, cchMaxBuffChars);
}
HRESULT CVisualStylesXP::GetThemeBool(HTHEME hTheme, int iPartId, int iStateId, int iPropId, BOOL *pfVal)
{
static PFNGETTHEMEBOOL pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMEBOOL)GetProc("GetThemeBool", (void*)GetThemeBoolFail);
return (*pfn)(hTheme, iPartId, iStateId, iPropId, pfVal);
}
HRESULT CVisualStylesXP::GetThemeInt(HTHEME hTheme, int iPartId, int iStateId, int iPropId, int *piVal)
{
static PFNGETTHEMEINT pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMEINT)GetProc("GetThemeInt", (void*)GetThemeIntFail);
return (*pfn)(hTheme, iPartId, iStateId, iPropId, piVal);
}
HRESULT CVisualStylesXP::GetThemeEnumValue(HTHEME hTheme, int iPartId, int iStateId, int iPropId, int *piVal)
{
static PFNGETTHEMEENUMVALUE pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMEENUMVALUE)GetProc("GetThemeEnumValue", (void*)GetThemeEnumValueFail);
return (*pfn)(hTheme, iPartId, iStateId, iPropId, piVal);
}
HRESULT CVisualStylesXP::GetThemePosition(HTHEME hTheme, int iPartId, int iStateId, int iPropId, POINT *pPoint)
{
static PFNGETTHEMEPOSITION pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMEPOSITION)GetProc("GetThemePosition", (void*)GetThemePositionFail);
return (*pfn)(hTheme, iPartId, iStateId, iPropId, pPoint);
}
HRESULT CVisualStylesXP::GetThemeFont(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, LOGFONT *pFont)
{
static PFNGETTHEMEFONT pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMEFONT)GetProc("GetThemeFont", (void*)GetThemeFontFail);
return (*pfn)(hTheme, hdc, iPartId, iStateId, iPropId, pFont);
}
HRESULT CVisualStylesXP::GetThemeRect(HTHEME hTheme, int iPartId, int iStateId, int iPropId, RECT *pRect)
{
static PFNGETTHEMERECT pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMERECT)GetProc("GetThemeRect", (void*)GetThemeRectFail);
return (*pfn)(hTheme, iPartId, iStateId, iPropId, pRect);
}
HRESULT CVisualStylesXP::GetThemeMargins(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, RECT *prc,
MARGINS *pMargins)
{
static PFNGETTHEMEMARGINS pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMEMARGINS)GetProc("GetThemeMargins", (void*)GetThemeMarginsFail);
return (*pfn)(hTheme, hdc, iPartId, iStateId, iPropId, prc, pMargins);
}
HRESULT CVisualStylesXP::GetThemeIntList(HTHEME hTheme, int iPartId, int iStateId, int iPropId, INTLIST *pIntList)
{
static PFNGETTHEMEINTLIST pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMEINTLIST)GetProc("GetThemeIntList", (void*)GetThemeIntListFail);
return (*pfn)(hTheme, iPartId, iStateId, iPropId, pIntList);
}
HRESULT CVisualStylesXP::GetThemePropertyOrigin(HTHEME hTheme, int iPartId, int iStateId, int iPropId,
enum PROPERTYORIGIN *pOrigin)
{
static PFNGETTHEMEPROPERTYORIGIN pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMEPROPERTYORIGIN)GetProc("GetThemePropertyOrigin", (void*)GetThemePropertyOriginFail);
return (*pfn)(hTheme, iPartId, iStateId, iPropId, pOrigin);
}
HRESULT CVisualStylesXP::SetWindowTheme(HWND hwnd, LPCWSTR pszSubAppName, LPCWSTR pszSubIdList)
{
static PFNSETWINDOWTHEME pfn = NULL;
if (pfn == NULL)
pfn = (PFNSETWINDOWTHEME)GetProc("SetWindowTheme", (void*)SetWindowThemeFail);
return (*pfn)(hwnd, pszSubAppName, pszSubIdList);
}
HRESULT CVisualStylesXP::GetThemeFilename(HTHEME hTheme, int iPartId, int iStateId, int iPropId,
LPWSTR pszThemeFileName, int cchMaxBuffChars)
{
static PFNGETTHEMEFILENAME pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMEFILENAME)GetProc("GetThemeFilename", (void*)GetThemeFilenameFail);
return (*pfn)(hTheme, iPartId, iStateId, iPropId, pszThemeFileName, cchMaxBuffChars);
}
COLORREF CVisualStylesXP::GetThemeSysColor(HTHEME hTheme, int iColorId)
{
static PFNGETTHEMESYSCOLOR pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMESYSCOLOR)GetProc("GetThemeSysColor", (void*)GetThemeSysColorFail);
return (*pfn)(hTheme, iColorId);
}
HBRUSH CVisualStylesXP::GetThemeSysColorBrush(HTHEME hTheme, int iColorId)
{
static PFNGETTHEMESYSCOLORBRUSH pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMESYSCOLORBRUSH)GetProc("GetThemeSysColorBrush", (void*)GetThemeSysColorBrushFail);
return (*pfn)(hTheme, iColorId);
}
BOOL CVisualStylesXP::GetThemeSysBool(HTHEME hTheme, int iBoolId)
{
static PFNGETTHEMESYSBOOL pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMESYSBOOL)GetProc("GetThemeSysBool", (void*)GetThemeSysBoolFail);
return (*pfn)(hTheme, iBoolId);
}
int CVisualStylesXP::GetThemeSysSize(HTHEME hTheme, int iSizeId)
{
static PFNGETTHEMESYSSIZE pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMESYSSIZE)GetProc("GetThemeSysSize", (void*)GetThemeSysSizeFail);
return (*pfn)(hTheme, iSizeId);
}
HRESULT CVisualStylesXP::GetThemeSysFont(HTHEME hTheme, int iFontId, LOGFONT *plf)
{
static PFNGETTHEMESYSFONT pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMESYSFONT)GetProc("GetThemeSysFont", (void*)GetThemeSysFontFail);
return (*pfn)(hTheme, iFontId, plf);
}
HRESULT CVisualStylesXP::GetThemeSysString(HTHEME hTheme, int iStringId, LPWSTR pszStringBuff, int cchMaxStringChars)
{
static PFNGETTHEMESYSSTRING pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMESYSSTRING)GetProc("GetThemeSysString", (void*)GetThemeSysStringFail);
return (*pfn)(hTheme, iStringId, pszStringBuff, cchMaxStringChars);
}
HRESULT CVisualStylesXP::GetThemeSysInt(HTHEME hTheme, int iIntId, int *piValue)
{
static PFNGETTHEMESYSINT pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMESYSINT)GetProc("GetThemeSysInt", (void*)GetThemeSysIntFail);
return (*pfn)(hTheme, iIntId, piValue);
}
BOOL CVisualStylesXP::IsThemeActive()
{
static PFNISTHEMEACTIVE pfn = NULL;
if (pfn == NULL)
pfn = (PFNISTHEMEACTIVE)GetProc("IsThemeActive", (void*)IsThemeActiveFail);
return (*pfn)();
}
BOOL CVisualStylesXP::IsAppThemed()
{
static PFNISAPPTHEMED pfn = NULL;
if (pfn == NULL)
pfn = (PFNISAPPTHEMED)GetProc("IsAppThemed", (void*)IsAppThemedFail);
return (*pfn)();
}
HTHEME CVisualStylesXP::GetWindowTheme(HWND hwnd)
{
static PFNGETWINDOWTHEME pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETWINDOWTHEME)GetProc("GetWindowTheme", (void*)GetWindowThemeFail);
return (*pfn)(hwnd);
}
HRESULT CVisualStylesXP::EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags)
{
static PFNENABLETHEMEDIALOGTEXTURE pfn = NULL;
if (pfn == NULL)
pfn = (PFNENABLETHEMEDIALOGTEXTURE)GetProc("EnableThemeDialogTexture", (void*)EnableThemeDialogTextureFail);
return (*pfn)(hwnd, dwFlags);
}
BOOL CVisualStylesXP::IsThemeDialogTextureEnabled(HWND hwnd)
{
static PFNISTHEMEDIALOGTEXTUREENABLED pfn = NULL;
if (pfn == NULL)
pfn = (PFNISTHEMEDIALOGTEXTUREENABLED)GetProc("IsThemeDialogTextureEnabled", (void*)IsThemeDialogTextureEnabledFail);
return (*pfn)(hwnd);
}
DWORD CVisualStylesXP::GetThemeAppProperties()
{
static PFNGETTHEMEAPPPROPERTIES pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMEAPPPROPERTIES)GetProc("GetThemeAppProperties", (void*)GetThemeAppPropertiesFail);
return (*pfn)();
}
void CVisualStylesXP::SetThemeAppProperties(DWORD dwFlags)
{
static PFNSETTHEMEAPPPROPERTIES pfn = NULL;
if (pfn == NULL)
pfn = (PFNSETTHEMEAPPPROPERTIES)GetProc("SetThemeAppProperties", (void*)SetThemeAppPropertiesFail);
(*pfn)(dwFlags);
}
HRESULT CVisualStylesXP::GetCurrentThemeName(LPWSTR pszThemeFileName, int cchMaxNameChars,
LPWSTR pszColorBuff, int cchMaxColorChars,
LPWSTR pszSizeBuff, int cchMaxSizeChars)
{
static PFNGETCURRENTTHEMENAME pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETCURRENTTHEMENAME)GetProc("GetCurrentThemeName", (void*)GetCurrentThemeNameFail);
return (*pfn)(pszThemeFileName, cchMaxNameChars, pszColorBuff, cchMaxColorChars, pszSizeBuff, cchMaxSizeChars);
}
HRESULT CVisualStylesXP::GetThemeDocumentationProperty(LPCWSTR pszThemeName, LPCWSTR pszPropertyName,
LPWSTR pszValueBuff, int cchMaxValChars)
{
static PFNGETTHEMEDOCUMENTATIONPROPERTY pfn = NULL;
if (pfn == NULL)
pfn = (PFNGETTHEMEDOCUMENTATIONPROPERTY)GetProc("GetThemeDocumentationProperty", (void*)GetThemeDocumentationPropertyFail);
return (*pfn)(pszThemeName, pszPropertyName, pszValueBuff, cchMaxValChars);
}
HRESULT CVisualStylesXP::DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT* prc)
{
static PFNDRAWTHEMEPARENTBACKGROUND pfn = NULL;
if (pfn == NULL)
pfn = (PFNDRAWTHEMEPARENTBACKGROUND)GetProc("DrawThemeParentBackground", (void*)DrawThemeParentBackgroundFail);
return (*pfn)(hwnd, hdc, prc);
}
HRESULT CVisualStylesXP::EnableTheming(BOOL fEnable)
{
static PFNENABLETHEMING pfn = NULL;
if (pfn == NULL)
pfn = (PFNENABLETHEMING)GetProc("EnableTheming", (void*)EnableThemingFail);
return (*pfn)(fEnable);
}