Now, a modified version of David Y. Zhao's Visual Styles support class[^]
Apologies if there are some irrelevant export directives and missing constants. Let me know if there is anything important missing. Somewhere I think there's an operating system version test using a class of mine - you can easily find code elsewhere to do an equivalent test.
#ifndef _VISUALSTYLE_XP_H_
#define _VISUALSTYLE_XP_H_
#pragma once
#include <uxtheme.h>
#if _MSC_VER >= 1500
#if ((NTDDI_VERSION >= NTDDI_LONGHORN || defined(__VSSYM32_H__)) && !defined(SCHEMA_VERIFY_VSSYM32))
#include <vssym32.h>
#else
#include <tmschema.h>
#endif
#else
#include "tmschema.h"
#endif
#include "TempThemeHandle.h"
enum EXP_State {
XPS_NORMAL =1,
XPS_HOT =2,
XPS_PRESSED =3,
XPS_DISABLED=4
};
enum EXP_ToolBarState {
XPS_TB_NORMAL =1,
XPS_TB_HOT =2,
XPS_TB_PRESSED =3,
XPS_TB_DISABLED =4,
XPS_TB_CHECKED =5,
XPS_TB_HOTCHECKED =6
};
enum EXP_SliderThumbState {
XPS_ST_NORMAL =1,
XPS_ST_HOT =2,
XPS_ST_PRESSED =3,
XPS_ST_FOCUS =4,
XPS_ST_DISABLED=5
};
enum EXP_CheckBoxIndex {
XPS_CB_Unchecked =0,
XPS_CB_Checked =4,
XPS_CB_Mixed =8
};
enum EXP_SBArrowsIndex {
XPS_SBArrows_Up =0,
XPS_SBArrows_Down =4,
XPS_SBArrows_Left =8,
XPS_SBArrows_Right =12
};
#define GP_BORDER 1
#define GP_LINEHORZ 2
#define GP_LINEVERT 3
#define BSS_FLAT 1
#define BSS_RAISED 2
#define BSS_SUNKEN 3
#define LHS_FLAT 1
#define LHS_RAISED 2
#define LHS_SUNKEN 3
#define LVS_FLAT 1
#define LVS_RAISED 2
#define LVS_SUNKEN 3
#pragma warning (disable : 4100)
class CVisualStylesXP
{
public:
static CVisualStylesXP * GetInstance ();
static void DeleteInstance ();
bool DrawThemeBackgroundPart(HWND hwnd,LPCWSTR pszClassList,HDC hdc,int iPartId,int iStateId,const RECT *pRect,const RECT *pClipRect);
HRESULT DrawThemeBackground(HTHEME hTheme,HWND hWnd,HDC hdc,int iPartId,int iStateId, RECT* pRect,const RECT* pClipRect);
bool IsAppUsingThemes();
bool CheckIfAppIsUsingThemes();
DWORD GetComCtl32Version();
private:
static CVisualStylesXP *m_pVisualStylesXP;
DWORD m_nComCtl32Version;
private:
HMODULE m_hThemeDll;
void* GetProc(LPCSTR szProc, void* pfnFail);
typedef HTHEME(__stdcall *PFNOPENTHEMEDATA)(HWND hwnd, LPCWSTR pszClassList);
static HTHEME __stdcall OpenThemeDataFail(HWND , LPCWSTR )
{return NULL;}
typedef HRESULT(__stdcall *PFNCLOSETHEMEDATA)(HTHEME hTheme);
static HRESULT CloseThemeDataFail(HTHEME)
{return E_FAIL;}
typedef HRESULT(__stdcall *PFNDRAWTHEMEBACKGROUND)(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect);
static HRESULT DrawThemeBackgroundFail(HTHEME, HDC, int, int, const RECT *, const RECT *)
{return E_FAIL;}
typedef HRESULT(__stdcall *PFNDRAWTHEMEBACKGROUNDEX)(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, const RECT *pRect, const DTBGOPTS * pOptions);
static HRESULT DrawThemeBackgroundExFail(HTHEME, HDC, int, int, const RECT *, const DTBGOPTS *)
{return E_FAIL;}
typedef HRESULT (__stdcall *PFNDRAWTHEMETEXT)(HTHEME hTheme, HDC hdc, int iPartId,
int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags,
DWORD dwTextFlags2, const RECT *pRect);
static HRESULT DrawThemeTextFail(HTHEME, HDC, int, int, LPCWSTR, int, DWORD, DWORD, const RECT*)
{return E_FAIL;}
typedef HRESULT (__stdcall *PFNGETTHEMEBACKGROUNDCONTENTRECT)(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, const RECT *pBoundingRect,
RECT *pContentRect);
static HRESULT GetThemeBackgroundContentRectFail(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, const RECT *pBoundingRect,
RECT *pContentRect)
{return E_FAIL;}
typedef HRESULT (__stdcall *PFNGETTHEMEBACKGROUNDEXTENT)(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, const RECT *pContentRect,
RECT *pExtentRect);
static HRESULT GetThemeBackgroundExtentFail(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, const RECT *pContentRect,
RECT *pExtentRect)
{return E_FAIL;}
typedef HRESULT(__stdcall *PFNGETTHEMEPARTSIZE)(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, RECT * pRect, enum THEMESIZE eSize, SIZE *psz);
static HRESULT GetThemePartSizeFail(HTHEME, HDC, int, int, RECT *, enum THEMESIZE, SIZE *)
{return E_FAIL;}
typedef HRESULT (__stdcall *PFNGETTHEMETEXTEXTENT)(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, LPCWSTR pszText, int iCharCount,
DWORD dwTextFlags, const RECT *pBoundingRect,
RECT *pExtentRect);
static HRESULT GetThemeTextExtentFail(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, LPCWSTR pszText, int iCharCount,
DWORD dwTextFlags, const RECT *pBoundingRect,
RECT *pExtentRect)
{return E_FAIL;}
typedef HRESULT (__stdcall *PFNGETTHEMETEXTMETRICS)(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, TEXTMETRIC* ptm);
static HRESULT GetThemeTextMetricsFail(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, TEXTMETRIC* ptm)
{return E_FAIL;}
typedef HRESULT (__stdcall *PFNGETTHEMEBACKGROUNDREGION)(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, const RECT *pRect, HRGN *pRegion);
static HRESULT GetThemeBackgroundRegionFail(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, const RECT *pRect, HRGN *pRegion)
{return E_FAIL;}
typedef HRESULT (__stdcall *PFNHITTESTTHEMEBACKGROUND)(HTHEME hTheme, HDC hdc, int iPartId,
int iStateId, DWORD dwOptions, const RECT *pRect, HRGN hrgn,
POINT ptTest, WORD *pwHitTestCode);
static HRESULT HitTestThemeBackgroundFail(HTHEME hTheme, HDC hdc, int iPartId,
int iStateId, DWORD dwOptions, const RECT *pRect, HRGN hrgn,
POINT ptTest, WORD *pwHitTestCode)
{return E_FAIL;}
typedef HRESULT (__stdcall *PFNDRAWTHEMEEDGE)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId,
const RECT *pDestRect, UINT uEdge, UINT uFlags, RECT *pContentRect);
static HRESULT DrawThemeEdgeFail(HTHEME hTheme, HDC hdc, int iPartId, int iStateId,
const RECT *pDestRect, UINT uEdge, UINT uFlags, RECT *pContentRect)
{return E_FAIL;}
typedef HRESULT (__stdcall *PFNDRAWTHEMEICON)(HTHEME hTheme, HDC hdc, int iPartId,
int iStateId, const RECT *pRect, HIMAGELIST himl, int iImageIndex);
static HRESULT DrawThemeIconFail(HTHEME hTheme, HDC hdc, int iPartId,
int iStateId, const RECT *pRect, HIMAGELIST himl, int iImageIndex)
{return E_FAIL;}
typedef BOOL (__stdcall *PFNISTHEMEPARTDEFINED)(HTHEME hTheme, int iPartId,
int iStateId);
static BOOL IsThemePartDefinedFail(HTHEME hTheme, int iPartId,
int iStateId)
{return FALSE;}
typedef BOOL (__stdcall *PFNISTHEMEBACKGROUNDPARTIALLYTRANSPARENT)(HTHEME hTheme,
int iPartId, int iStateId);
static BOOL IsThemeBackgroundPartiallyTransparentFail(HTHEME hTheme,
int iPartId, int iStateId)
{return FALSE;}
typedef HRESULT (__stdcall *PFNGETTHEMECOLOR)(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, COLORREF *pColor);
static HRESULT GetThemeColorFail(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, COLORREF *pColor)
{return E_FAIL;}
typedef HRESULT (__stdcall *PFNGETTHEMEMETRIC)(HTHEME hTheme, HDC hdc, int iPartId,
int iStateId, int iPropId, int *piVal);
static HRESULT GetThemeMetricFail(HTHEME hTheme, HDC hdc, int iPartId,
int iStateId, int iPropId, int *piVal)
{return E_FAIL;}
typedef HRESULT (__stdcall *PFNGETTHEMESTRING)(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, LPWSTR pszBuff, int cchMaxBuffChars);
static HRESULT GetThemeStringFail(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, LPWSTR pszBuff, int cchMaxBuffChars)
{return E_FAIL;}
typedef HRESULT (__stdcall *PFNGETTHEMEBOOL)(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, BOOL *pfVal);
static HRESULT GetThemeBoolFail(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, BOOL *pfVal)
{return E_FAIL;}
typedef HRESULT (__stdcall *PFNGETTHEMEINT)(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, int *piVal);
static HRESULT GetThemeIntFail(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, int *piVal)
{return E_FAIL;}
typedef HRESULT (__stdcall *PFNGETTHEMEENUMVALUE)(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, int *piVal);
static HRESULT GetThemeEnumValueFail(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, int *piVal)
{return E_FAIL;}
typedef HRESULT (__stdcall *PFNGETTHEMEPOSITION)(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, POINT *pPoint);
static HRESULT GetThemePositionFail(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, POINT *pPoint)
{return E_FAIL;}
typedef HRESULT (__stdcall *PFNGETTHEMEFONT)(HTHEME hTheme, HDC hdc, int iPartId,
int iStateId, int iPropId, LOGFONTW *pFont);
static HRESULT GetThemeFontFail(HTHEME hTheme, HDC hdc, int iPartId,
int iStateId, int iPropId, LOGFONTW *pFont)
{return E_FAIL;}
typedef HRESULT (__stdcall *PFNGETTHEMERECT)(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, RECT *pRect);
static HRESULT GetThemeRectFail(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, RECT *pRect)
{return E_FAIL;}
typedef HRESULT (__stdcall *PFNGETTHEMEMARGINS)(HTHEME hTheme, HDC hdc, int iPartId,
int iStateId, int iPropId, RECT *prc, MARGINS *pMargins);
static HRESULT GetThemeMarginsFail(HTHEME hTheme, HDC hdc, int iPartId,
int iStateId, int iPropId, RECT *prc, MARGINS *pMargins)
{return E_FAIL;}
typedef HRESULT (__stdcall *PFNGETTHEMEINTLIST)(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, INTLIST *pIntList);
static HRESULT GetThemeIntListFail(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, INTLIST *pIntList)
{return E_FAIL;}
typedef HRESULT (__stdcall *PFNGETTHEMEPROPERTYORIGIN)(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, enum PROPERTYORIGIN *pOrigin);
static HRESULT GetThemePropertyOriginFail(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, enum PROPERTYORIGIN *pOrigin)
{return E_FAIL;}
typedef HRESULT (__stdcall *PFNSETWINDOWTHEME)(HWND hwnd, LPCWSTR pszSubAppName,
LPCWSTR pszSubIdList);
static HRESULT SetWindowThemeFail(HWND hwnd, LPCWSTR pszSubAppName,
LPCWSTR pszSubIdList)
{return E_FAIL;}
typedef HRESULT (__stdcall *PFNGETTHEMEFILENAME)(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, LPWSTR pszThemeFileName, int cchMaxBuffChars);
static HRESULT GetThemeFilenameFail(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, LPWSTR pszThemeFileName, int cchMaxBuffChars)
{return E_FAIL;}
typedef COLORREF (__stdcall *PFNGETTHEMESYSCOLOR)(HTHEME hTheme, int iColorId);
static COLORREF GetThemeSysColorFail(HTHEME hTheme, int iColorId)
{return RGB(255,255,255);}
typedef HBRUSH (__stdcall *PFNGETTHEMESYSCOLORBRUSH)(HTHEME hTheme, int iColorId);
static HBRUSH GetThemeSysColorBrushFail(HTHEME hTheme, int iColorId)
{return NULL;}
typedef BOOL (__stdcall *PFNGETTHEMESYSBOOL)(HTHEME hTheme, int iBoolId);
static BOOL GetThemeSysBoolFail(HTHEME hTheme, int iBoolId)
{return FALSE;}
typedef int (__stdcall *PFNGETTHEMESYSSIZE)(HTHEME hTheme, int iSizeId);
static int GetThemeSysSizeFail(HTHEME hTheme, int iSizeId)
{return 0;}
typedef HRESULT (__stdcall *PFNGETTHEMESYSFONT)(HTHEME hTheme, int iFontId, LOGFONTW *plf);
static HRESULT GetThemeSysFontFail(HTHEME hTheme, int iFontId, LOGFONTW *plf)
{return E_FAIL;}
typedef HRESULT (__stdcall *PFNGETTHEMESYSSTRING)(HTHEME hTheme, int iStringId,
LPWSTR pszStringBuff, int cchMaxStringChars);
static HRESULT GetThemeSysStringFail(HTHEME hTheme, int iStringId,
LPWSTR pszStringBuff, int cchMaxStringChars)
{return E_FAIL;}
typedef HRESULT (__stdcall *PFNGETTHEMESYSINT)(HTHEME hTheme, int iIntId, int *piValue);
static HRESULT GetThemeSysIntFail(HTHEME hTheme, int iIntId, int *piValue)
{return E_FAIL;}
typedef BOOL (__stdcall *PFNISTHEMEACTIVE)();
static BOOL IsThemeActiveFail()
{return FALSE;}
typedef BOOL(__stdcall *PFNISAPPTHEMED)();
static BOOL IsAppThemedFail()
{return FALSE;}
typedef HTHEME (__stdcall *PFNGETWINDOWTHEME)(HWND hwnd);
static HTHEME GetWindowThemeFail(HWND hwnd)
{return NULL;}
typedef HRESULT (__stdcall *PFNENABLETHEMEDIALOGTEXTURE)(HWND hwnd, DWORD dwFlags);
static HRESULT EnableThemeDialogTextureFail(HWND hwnd, DWORD dwFlags)
{return E_FAIL;}
typedef BOOL (__stdcall *PFNISTHEMEDIALOGTEXTUREENABLED)(HWND hwnd);
static BOOL IsThemeDialogTextureEnabledFail(HWND hwnd)
{return FALSE;}
typedef DWORD (__stdcall *PFNGETTHEMEAPPPROPERTIES)();
static DWORD GetThemeAppPropertiesFail()
{return 0;}
typedef void (__stdcall *PFNSETTHEMEAPPPROPERTIES)(DWORD dwFlags);
static void SetThemeAppPropertiesFail(DWORD dwFlags)
{return;}
typedef HRESULT (__stdcall *PFNGETCURRENTTHEMENAME)(
LPWSTR pszThemeFileName, int cchMaxNameChars,
LPWSTR pszColorBuff, int cchMaxColorChars,
LPWSTR pszSizeBuff, int cchMaxSizeChars);
static HRESULT GetCurrentThemeNameFail(
LPWSTR pszThemeFileName, int cchMaxNameChars,
LPWSTR pszColorBuff, int cchMaxColorChars,
LPWSTR pszSizeBuff, int cchMaxSizeChars)
{return E_FAIL;}
typedef HRESULT (__stdcall *PFNGETTHEMEDOCUMENTATIONPROPERTY)(LPCWSTR pszThemeName,
LPCWSTR pszPropertyName, LPWSTR pszValueBuff, int cchMaxValChars);
static HRESULT GetThemeDocumentationPropertyFail(LPCWSTR pszThemeName,
LPCWSTR pszPropertyName, LPWSTR pszValueBuff, int cchMaxValChars)
{return E_FAIL;}
typedef HRESULT (__stdcall *PFNDRAWTHEMEPARENTBACKGROUND)(HWND hwnd, HDC hdc, RECT* prc);
static HRESULT DrawThemeParentBackgroundFail(HWND hwnd, HDC hdc, RECT* prc)
{return E_FAIL;}
typedef HRESULT (__stdcall *PFNENABLETHEMING)(BOOL fEnable);
static HRESULT EnableThemingFail(BOOL fEnable)
{return E_FAIL;}
public:
HTHEME OpenThemeData(HWND hwnd, LPCWSTR pszClassList);
HRESULT CloseThemeData(HTHEME hTheme);
HRESULT DrawThemeBackground(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect);
HRESULT DrawThemeText(HTHEME hTheme, HDC hdc, int iPartId,
int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags,
DWORD dwTextFlags2, const RECT *pRect);
HRESULT GetThemeBackgroundContentRect(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, const RECT *pBoundingRect,
RECT *pContentRect);
HRESULT GetThemeBackgroundExtent(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, const RECT *pContentRect,
RECT *pExtentRect);
HRESULT GetThemePartSize(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, RECT * pRect, enum THEMESIZE eSize, SIZE *psz);
HRESULT GetThemeTextExtent(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, LPCWSTR pszText, int iCharCount,
DWORD dwTextFlags, const RECT *pBoundingRect,
RECT *pExtentRect);
HRESULT GetThemeTextMetrics(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, TEXTMETRIC* ptm);
HRESULT GetThemeBackgroundRegion(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, const RECT *pRect, HRGN *pRegion);
HRESULT HitTestThemeBackground(HTHEME hTheme, HDC hdc, int iPartId,
int iStateId, DWORD dwOptions, const RECT *pRect, HRGN hrgn,
POINT ptTest, WORD *pwHitTestCode);
HRESULT DrawThemeEdge(HTHEME hTheme, HDC hdc, int iPartId, int iStateId,
const RECT *pDestRect, UINT uEdge, UINT uFlags, RECT *pContentRect);
HRESULT DrawThemeIcon(HTHEME hTheme, HDC hdc, int iPartId,
int iStateId, const RECT *pRect, HIMAGELIST himl, int iImageIndex);
BOOL IsThemePartDefined(HTHEME hTheme, int iPartId,
int iStateId);
BOOL IsThemeBackgroundPartiallyTransparent(HTHEME hTheme,
int iPartId, int iStateId);
HRESULT GetThemeColor(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, COLORREF *pColor);
HRESULT GetThemeMetric(HTHEME hTheme, HDC hdc, int iPartId,
int iStateId, int iPropId, int *piVal);
HRESULT GetThemeString(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, LPWSTR pszBuff, int cchMaxBuffChars);
HRESULT GetThemeBool(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, BOOL *pfVal);
HRESULT GetThemeInt(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, int *piVal);
HRESULT GetThemeEnumValue(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, int *piVal);
HRESULT GetThemePosition(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, POINT *pPoint);
HRESULT GetThemeFont(HTHEME hTheme, HDC hdc, int iPartId,
int iStateId, int iPropId, LOGFONTW *pFont);
HRESULT GetThemeRect(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, RECT *pRect);
HRESULT GetThemeMargins(HTHEME hTheme, HDC hdc, int iPartId,
int iStateId, int iPropId, RECT *prc, MARGINS *pMargins);
HRESULT GetThemeIntList(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, INTLIST *pIntList);
HRESULT GetThemePropertyOrigin(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, enum PROPERTYORIGIN *pOrigin);
HRESULT SetWindowTheme(HWND hwnd, LPCWSTR pszSubAppName,
LPCWSTR pszSubIdList);
HRESULT GetThemeFilename(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, LPWSTR pszThemeFileName, int cchMaxBuffChars);
COLORREF GetThemeSysColor(HTHEME hTheme, int iColorId);
HBRUSH GetThemeSysColorBrush(HTHEME hTheme, int iColorId);
BOOL GetThemeSysBool(HTHEME hTheme, int iBoolId);
int GetThemeSysSize(HTHEME hTheme, int iSizeId);
HRESULT GetThemeSysFont(HTHEME hTheme, int iFontId, LOGFONTW *plf);
HRESULT GetThemeSysString(HTHEME hTheme, int iStringId,
LPWSTR pszStringBuff, int cchMaxStringChars);
HRESULT GetThemeSysInt(HTHEME hTheme, int iIntId, int *piValue);
BOOL IsThemeActive();
BOOL IsAppThemed();
HTHEME GetWindowTheme(HWND hwnd);
HRESULT EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags);
BOOL IsThemeDialogTextureEnabled(HWND hwnd);
DWORD GetThemeAppProperties();
void SetThemeAppProperties(DWORD dwFlags);
HRESULT GetCurrentThemeName(
LPWSTR pszThemeFileName, int cchMaxNameChars,
LPWSTR pszColorBuff, int cchMaxColorChars,
LPWSTR pszSizeBuff, int cchMaxSizeChars);
HRESULT GetThemeDocumentationProperty(LPCWSTR pszThemeName,
LPCWSTR pszPropertyName, LPWSTR pszValueBuff, int cchMaxValChars);
HRESULT DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT* prc);
HRESULT DrawThemeBackgroundEx(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const DTBGOPTS *pOptions);
HRESULT EnableTheming(BOOL fEnable);
public:
CVisualStylesXP(void);
~CVisualStylesXP(void);
};
#pragma warning( default : 4100)
#endif
-----------------------------------------------------------------------------------------------
#include "stdAfx.h"
#include "..\stdafx.h" // Repeat include for the benefit of idiot dumbed-down Intellisense in VS2005+
#include "visualstylesxp.h"
CVisualStylesXP *CVisualStylesXP::m_pVisualStylesXP = NULL;
CVisualStylesXP * CVisualStylesXP::GetInstance ()
{
if (!m_pVisualStylesXP)
{
m_pVisualStylesXP = new CVisualStylesXP;
}
return m_pVisualStylesXP;
}
void CVisualStylesXP::DeleteInstance ()
{
if (m_pVisualStylesXP)
{
delete m_pVisualStylesXP;
m_pVisualStylesXP = NULL;
}
}
CVisualStylesXP::CVisualStylesXP(void)
{
CWindowsErrorModeSwitcher switcherErrorMode(SEM_FAILCRITICALERRORS);
m_hThemeDll = LoadLibrary(_T("UxTheme.dll"));
m_nComCtl32Version = (DWORD)-1;
}
CVisualStylesXP::~CVisualStylesXP(void)
{
if (m_hThemeDll!=NULL)
FreeLibrary(m_hThemeDll);
m_hThemeDll = NULL;
}
void* CVisualStylesXP::GetProc(LPCSTR szProc, void* pfnFail)
{
void* pRet = pfnFail;
if (m_hThemeDll != NULL)
pRet = GetProcAddress(m_hThemeDll, szProc);
return pRet;
}
HTHEME CVisualStylesXP::OpenThemeData(HWND hwnd, LPCWSTR pszClassList)
{
PFNOPENTHEMEDATA pfnOpenThemeData = (PFNOPENTHEMEDATA)GetProc("OpenThemeData", (void*)OpenThemeDataFail);
return (*pfnOpenThemeData)(hwnd, pszClassList);
}
HRESULT CVisualStylesXP::CloseThemeData(HTHEME hTheme)
{
PFNCLOSETHEMEDATA pfnCloseThemeData = (PFNCLOSETHEMEDATA)GetProc("CloseThemeData", (void*)CloseThemeDataFail);
return (*pfnCloseThemeData)(hTheme);
}
HRESULT CVisualStylesXP::DrawThemeBackground(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect)
{
PFNDRAWTHEMEBACKGROUND pfnDrawThemeBackground =
(PFNDRAWTHEMEBACKGROUND)GetProc("DrawThemeBackground", (void*)DrawThemeBackgroundFail);
return (*pfnDrawThemeBackground)(hTheme, hdc, iPartId, iStateId, pRect, pClipRect);
}
HRESULT CVisualStylesXP::DrawThemeBackgroundEx(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, const RECT *pRect, const DTBGOPTS *pOptions)
{
PFNDRAWTHEMEBACKGROUNDEX pfnDrawThemeBackgroundEx =
(PFNDRAWTHEMEBACKGROUNDEX)GetProc("DrawThemeBackgroundEx", (void*)DrawThemeBackgroundExFail);
return (*pfnDrawThemeBackgroundEx)(hTheme, hdc, iPartId, iStateId, pRect, pOptions);
}
bool CVisualStylesXP::DrawThemeBackgroundPart(HWND hwnd, LPCWSTR pszClassList, HDC hdc,
int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect)
{
if (CVisualStylesXP::GetInstance()->IsAppUsingThemes())
{
CTempThemeHandle tempHandle(hwnd, pszClassList);
VERIFY( CVisualStylesXP::GetInstance()->DrawThemeBackground(tempHandle.GetThemeHandle(), hdc, iPartId, iStateId, pRect, pClipRect) == S_OK);
return true;
}
else
{
return false;
}
}
HRESULT CVisualStylesXP::DrawThemeBackground(HTHEME hTheme, HWND hWnd, HDC hdc, int iPartId, int iStateId, RECT* pRect, const RECT* pClipRect)
{
DrawThemeParentBackground(hWnd, hdc, pRect);
return DrawThemeBackground(hTheme, hdc, iPartId, iStateId, pRect, pClipRect);
} bool CVisualStylesXP::IsAppUsingThemes()
{
static int nCheckCounter = 0;
static bool bIsUsingThemes = false;
if (nCheckCounter < 20)
{
bIsUsingThemes = CheckIfAppIsUsingThemes();
nCheckCounter++;
}
return bIsUsingThemes;
}
bool CVisualStylesXP::CheckIfAppIsUsingThemes()
{
return (GetComCtl32Version() >= nCOMCTL_VERSION_XP && IsThemeActive() && IsAppThemed());
}
struct AFX_DLLVERSIONINFO
{
DWORD cbSize;
DWORD dwMajorVersion; DWORD dwMinorVersion; DWORD dwBuildNumber; DWORD dwPlatformID; };
typedef HRESULT (CALLBACK* AFX_DLLGETVERSIONPROC)(AFX_DLLVERSIONINFO *);
DWORD CVisualStylesXP::GetComCtl32Version()
{
if (m_nComCtl32Version == -1)
{
HINSTANCE hInst = ::GetModuleHandle(sCOMCTL32_DLLNAME);
ASSERT(hInst != NULL);
if (hInst != NULL)
{
AFX_DLLGETVERSIONPROC pfn;
pfn = (AFX_DLLGETVERSIONPROC)GetProcAddress(hInst, "DllGetVersion");
DWORD dwVersion = nCOMCTL_VERSION_WIN4;
if (pfn != NULL)
{
AFX_DLLVERSIONINFO dvi;
memset(&dvi, 0, sizeof(dvi));
dvi.cbSize = sizeof(dvi);
HRESULT hr = (*pfn)(&dvi);
if (SUCCEEDED(hr))
{
ASSERT(dvi.dwMajorVersion <= 0xFFFF);
ASSERT(dvi.dwMinorVersion <= 0xFFFF);
dwVersion = MAKELONG(dvi.dwMinorVersion, dvi.dwMajorVersion);
}
}
m_nComCtl32Version = dwVersion;
}
}
return m_nComCtl32Version;
}
HRESULT CVisualStylesXP::DrawThemeText(HTHEME hTheme, HDC hdc, int iPartId,
int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags,
DWORD dwTextFlags2, const RECT *pRect)
{
PFNDRAWTHEMETEXT 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)
{
PFNGETTHEMEBACKGROUNDCONTENTRECT 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)
{
PFNGETTHEMEBACKGROUNDEXTENT 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)
{
PFNGETTHEMEPARTSIZE pfnGetThemePartSize =
(PFNGETTHEMEPARTSIZE)GetProc("GetThemePartSize", (void*)GetThemePartSizeFail);
return (*pfnGetThemePartSize)(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)
{
PFNGETTHEMETEXTEXTENT 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)
{
PFNGETTHEMETEXTMETRICS 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)
{
PFNGETTHEMEBACKGROUNDREGION 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)
{
PFNHITTESTTHEMEBACKGROUND 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)
{
PFNDRAWTHEMEEDGE 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)
{
PFNDRAWTHEMEICON pfn = (PFNDRAWTHEMEICON)GetProc("DrawThemeIcon", (void*)DrawThemeIconFail);
return (*pfn)(hTheme, hdc, iPartId, iStateId, pRect, himl, iImageIndex);
}
BOOL CVisualStylesXP::IsThemePartDefined(HTHEME hTheme, int iPartId,
int iStateId)
{
PFNISTHEMEPARTDEFINED pfn = (PFNISTHEMEPARTDEFINED)GetProc("IsThemePartDefined", (void*)IsThemePartDefinedFail);
return (*pfn)(hTheme, iPartId, iStateId);
}
BOOL CVisualStylesXP::IsThemeBackgroundPartiallyTransparent(HTHEME hTheme,
int iPartId, int iStateId)
{
PFNISTHEMEBACKGROUNDPARTIALLYTRANSPARENT pfn = (PFNISTHEMEBACKGROUNDPARTIALLYTRANSPARENT)GetProc("IsThemeBackgroundPartiallyTransparent", (void*)IsThemeBackgroundPartiallyTransparentFail);
return (*pfn)(hTheme, iPartId, iStateId);
}
HRESULT CVisualStylesXP::GetThemeColor(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, COLORREF *pColor)
{
PFNGETTHEMECOLOR 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)
{
PFNGETTHEMEMETRIC 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)
{
PFNGETTHEMESTRING 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)
{
PFNGETTHEMEBOOL 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)
{
PFNGETTHEMEINT 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)
{
PFNGETTHEMEENUMVALUE 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)
{
PFNGETTHEMEPOSITION 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, LOGFONTW *pFont)
{
PFNGETTHEMEFONT 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)
{
PFNGETTHEMERECT 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)
{
PFNGETTHEMEMARGINS 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)
{
PFNGETTHEMEINTLIST 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)
{
PFNGETTHEMEPROPERTYORIGIN pfn = (PFNGETTHEMEPROPERTYORIGIN)GetProc("GetThemePropertyOrigin", (void*)GetThemePropertyOriginFail);
return (*pfn)(hTheme, iPartId, iStateId, iPropId, pOrigin);
}
HRESULT CVisualStylesXP::SetWindowTheme(HWND hwnd, LPCWSTR pszSubAppName,
LPCWSTR pszSubIdList)
{
PFNSETWINDOWTHEME 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)
{
PFNGETTHEMEFILENAME pfn = (PFNGETTHEMEFILENAME)GetProc("GetThemeFilename", (void*)GetThemeFilenameFail);
return (*pfn)(hTheme, iPartId, iStateId, iPropId, pszThemeFileName, cchMaxBuffChars);
}
COLORREF CVisualStylesXP::GetThemeSysColor(HTHEME hTheme, int iColorId)
{
PFNGETTHEMESYSCOLOR pfn = (PFNGETTHEMESYSCOLOR)GetProc("GetThemeSysColor", (void*)GetThemeSysColorFail);
return (*pfn)(hTheme, iColorId);
}
HBRUSH CVisualStylesXP::GetThemeSysColorBrush(HTHEME hTheme, int iColorId)
{
PFNGETTHEMESYSCOLORBRUSH pfn = (PFNGETTHEMESYSCOLORBRUSH)GetProc("GetThemeSysColorBrush", (void*)GetThemeSysColorBrushFail);
return (*pfn)(hTheme, iColorId);
}
BOOL CVisualStylesXP::GetThemeSysBool(HTHEME hTheme, int iBoolId)
{
PFNGETTHEMESYSBOOL pfn = (PFNGETTHEMESYSBOOL)GetProc("GetThemeSysBool", (void*)GetThemeSysBoolFail);
return (*pfn)(hTheme, iBoolId);
}
int CVisualStylesXP::GetThemeSysSize(HTHEME hTheme, int iSizeId)
{
PFNGETTHEMESYSSIZE pfn = (PFNGETTHEMESYSSIZE)GetProc("GetThemeSysSize", (void*)GetThemeSysSizeFail);
return (*pfn)(hTheme, iSizeId);
}
HRESULT CVisualStylesXP::GetThemeSysFont(HTHEME hTheme, int iFontId, LOGFONTW *plf)
{
PFNGETTHEMESYSFONT pfn = (PFNGETTHEMESYSFONT)GetProc("GetThemeSysFont", (void*)GetThemeSysFontFail);
return (*pfn)(hTheme, iFontId, plf);
}
HRESULT CVisualStylesXP::GetThemeSysString(HTHEME hTheme, int iStringId,
LPWSTR pszStringBuff, int cchMaxStringChars)
{
PFNGETTHEMESYSSTRING pfn = (PFNGETTHEMESYSSTRING)GetProc("GetThemeSysString", (void*)GetThemeSysStringFail);
return (*pfn)(hTheme, iStringId, pszStringBuff, cchMaxStringChars);
}
HRESULT CVisualStylesXP::GetThemeSysInt(HTHEME hTheme, int iIntId, int *piValue)
{
PFNGETTHEMESYSINT pfn = (PFNGETTHEMESYSINT)GetProc("GetThemeSysInt", (void*)GetThemeSysIntFail);
return (*pfn)(hTheme, iIntId, piValue);
}
BOOL CVisualStylesXP::IsThemeActive()
{
PFNISTHEMEACTIVE pfn = (PFNISTHEMEACTIVE)GetProc("IsThemeActive", (void*)IsThemeActiveFail);
return (*pfn)();
}
BOOL CVisualStylesXP::IsAppThemed()
{
PFNISAPPTHEMED pfnIsAppThemed = (PFNISAPPTHEMED)GetProc("IsAppThemed", (void*)IsAppThemedFail);
return (*pfnIsAppThemed)();
}
HTHEME CVisualStylesXP::GetWindowTheme(HWND hwnd)
{
PFNGETWINDOWTHEME pfn = (PFNGETWINDOWTHEME)GetProc("GetWindowTheme", (void*)GetWindowThemeFail);
return (*pfn)(hwnd);
}
HRESULT CVisualStylesXP::EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags)
{
PFNENABLETHEMEDIALOGTEXTURE pfn = (PFNENABLETHEMEDIALOGTEXTURE)GetProc("EnableThemeDialogTexture", (void*)EnableThemeDialogTextureFail);
return (*pfn)(hwnd, dwFlags);
}
BOOL CVisualStylesXP::IsThemeDialogTextureEnabled(HWND hwnd)
{
PFNISTHEMEDIALOGTEXTUREENABLED pfn = (PFNISTHEMEDIALOGTEXTUREENABLED)GetProc("IsThemeDialogTextureEnabled", (void*)IsThemeDialogTextureEnabledFail);
return (*pfn)(hwnd);
}
DWORD CVisualStylesXP::GetThemeAppProperties()
{
PFNGETTHEMEAPPPROPERTIES pfn = (PFNGETTHEMEAPPPROPERTIES)GetProc("GetThemeAppProperties", (void*)GetThemeAppPropertiesFail);
return (*pfn)();
}
void CVisualStylesXP::SetThemeAppProperties(DWORD dwFlags)
{
PFNSETTHEMEAPPPROPERTIES pfn = (PFNSETTHEMEAPPPROPERTIES)GetProc("SetThemeAppProperties", (void*)SetThemeAppPropertiesFail);
(*pfn)(dwFlags);
}
HRESULT CVisualStylesXP::GetCurrentThemeName(
LPWSTR pszThemeFileName, int cchMaxNameChars,
LPWSTR pszColorBuff, int cchMaxColorChars,
LPWSTR pszSizeBuff, int cchMaxSizeChars)
{
PFNGETCURRENTTHEMENAME 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)
{
PFNGETTHEMEDOCUMENTATIONPROPERTY pfn = (PFNGETTHEMEDOCUMENTATIONPROPERTY)GetProc("GetThemeDocumentationProperty", (void*)GetThemeDocumentationPropertyFail);
return (*pfn)(pszThemeName, pszPropertyName, pszValueBuff, cchMaxValChars);
}
HRESULT CVisualStylesXP::DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT* prc)
{
PFNDRAWTHEMEPARENTBACKGROUND pfn = (PFNDRAWTHEMEPARENTBACKGROUND)GetProc("DrawThemeParentBackground", (void*)DrawThemeParentBackgroundFail);
return (*pfn)(hwnd, hdc, prc);
}
HRESULT CVisualStylesXP::EnableTheming(BOOL fEnable)
{
PFNENABLETHEMING pfn = (PFNENABLETHEMING)GetProc("EnableTheming", (void*)EnableThemingFail);
return (*pfn)(fEnable);
}
- Pfft. Coddled kids. In my day, we used to telnet to port 80, then render the page with pencil and paper-- and that's the way we liked it!
- Pshaw! Youngster. Your UID barely fits inside 16 bits. In _my_ day we had to whistle the 1's and 0's through an acoustic coupler!
Tools that support "all of UTF-8 as long as it starts with ASCII" and tools that cannot handle these three [BOM] bytes at all are not really supporting UTF-8.
- Michael Kaplan
modified on Wednesday, August 3, 2011 4:55 AM
|