VisualStylesXP.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Copyright (C) 2001-2002 by David Yuheng Zhao
  3. //
  4. // Distribute and change freely, except: don't remove my name from the source
  5. //
  6. // No warrantee of any kind, express or implied, is included with this
  7. // software; use at your own risk, responsibility for damages (if any) to
  8. // anyone resulting from the use of this software rests entirely with the
  9. // user.
  10. //
  11. // Partly based on the _ThemeHelper struct in MFC7.0 source code (winctrl3.cpp),
  12. // and the difference is that this implementation wraps the full set of
  13. // visual style APIs from the platform SDK August 2001
  14. //
  15. // If you have any questions, I can be reached as follows:
  16. // yuheng_zhao@yahoo.com
  17. //
  18. //
  19. // How to use:
  20. // Instead of calling the API directly,
  21. // OpenThemeData(...);
  22. // use the global variable
  23. // g_xpStyle.OpenThemeData(...);
  24. //
  25. //
  26. //
  27. // Date: 2002-07-27
  28. // This update was made by Mathias Tunared.
  29. // He changed the function variable to static to make the code faster.
  30. // He also added the function 'UseVisualStyles()' so you can check if to
  31. // draw with the visual styles or not. That function checks first the
  32. // version of the 'ComCtl32.dll' and the checks if the theme is activated
  33. // and the HTHEME handle is not NULL.
  34. //
  35. // CAdvComboBox Control
  36. // Version: 2.1
  37. // Date: August 2002
  38. // Author: Mathias Tunared
  39. // Email: Mathias@inorbit.com
  40. //
  41. // This file is provided "as is" with no expressed or implied warranty.
  42. // The author accepts no liability for any damage/loss of business that
  43. // this product may cause.
  44. //
  45. /////////////////////////////////////////////////////////////////////////////
  46. #ifndef _VISUALSTYLE_XP_H_
  47. #define _VISUALSTYLE_XP_H_
  48. #pragma once
  49. #pragma warning(push, 3)
  50. #include <uxtheme.h>
  51. #include <tmschema.h>
  52. class CVisualStylesXP
  53. {
  54. private:
  55. HMODULE m_hThemeDll;
  56. void* GetProc(LPCSTR szProc, void* pfnFail);
  57. typedef HTHEME(__stdcall *PFNOPENTHEMEDATA)(HWND hwnd, LPCWSTR pszClassList);
  58. static HTHEME OpenThemeDataFail(HWND , LPCWSTR )
  59. {return NULL;}
  60. typedef HRESULT(__stdcall *PFNCLOSETHEMEDATA)(HTHEME hTheme);
  61. static HRESULT CloseThemeDataFail(HTHEME)
  62. {return E_FAIL;}
  63. typedef HRESULT(__stdcall *PFNDRAWTHEMEBACKGROUND)(HTHEME hTheme, HDC hdc,
  64. int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect);
  65. static HRESULT DrawThemeBackgroundFail(HTHEME, HDC, int, int, const RECT *, const RECT *)
  66. {return E_FAIL;}
  67. typedef HRESULT (__stdcall *PFNDRAWTHEMETEXT)(HTHEME hTheme, HDC hdc, int iPartId,
  68. int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags,
  69. DWORD dwTextFlags2, const RECT *pRect);
  70. static HRESULT DrawThemeTextFail(HTHEME, HDC, int, int, LPCWSTR, int, DWORD, DWORD, const RECT*)
  71. {return E_FAIL;}
  72. typedef HRESULT (__stdcall *PFNGETTHEMEBACKGROUNDCONTENTRECT)(HTHEME hTheme, HDC hdc,
  73. int iPartId, int iStateId, const RECT *pBoundingRect,
  74. RECT *pContentRect);
  75. static HRESULT GetThemeBackgroundContentRectFail(HTHEME hTheme, HDC hdc,
  76. int iPartId, int iStateId, const RECT *pBoundingRect,
  77. RECT *pContentRect)
  78. {return E_FAIL;}
  79. typedef HRESULT (__stdcall *PFNGETTHEMEBACKGROUNDEXTENT)(HTHEME hTheme, HDC hdc,
  80. int iPartId, int iStateId, const RECT *pContentRect,
  81. RECT *pExtentRect);
  82. static HRESULT GetThemeBackgroundExtentFail(HTHEME hTheme, HDC hdc,
  83. int iPartId, int iStateId, const RECT *pContentRect,
  84. RECT *pExtentRect)
  85. {return E_FAIL;}
  86. typedef HRESULT(__stdcall *PFNGETTHEMEPARTSIZE)(HTHEME hTheme, HDC hdc,
  87. int iPartId, int iStateId, RECT * pRect, enum THEMESIZE eSize, SIZE *psz);
  88. static HRESULT GetThemePartSizeFail(HTHEME, HDC, int, int, RECT *, enum THEMESIZE, SIZE *)
  89. {return E_FAIL;}
  90. typedef HRESULT (__stdcall *PFNGETTHEMETEXTEXTENT)(HTHEME hTheme, HDC hdc,
  91. int iPartId, int iStateId, LPCWSTR pszText, int iCharCount,
  92. DWORD dwTextFlags, const RECT *pBoundingRect,
  93. RECT *pExtentRect);
  94. static HRESULT GetThemeTextExtentFail(HTHEME hTheme, HDC hdc,
  95. int iPartId, int iStateId, LPCWSTR pszText, int iCharCount,
  96. DWORD dwTextFlags, const RECT *pBoundingRect,
  97. RECT *pExtentRect)
  98. {return E_FAIL;}
  99. typedef HRESULT (__stdcall *PFNGETTHEMETEXTMETRICS)(HTHEME hTheme, HDC hdc,
  100. int iPartId, int iStateId, TEXTMETRIC* ptm);
  101. static HRESULT GetThemeTextMetricsFail(HTHEME hTheme, HDC hdc,
  102. int iPartId, int iStateId, TEXTMETRIC* ptm)
  103. {return E_FAIL;}
  104. typedef HRESULT (__stdcall *PFNGETTHEMEBACKGROUNDREGION)(HTHEME hTheme, HDC hdc,
  105. int iPartId, int iStateId, const RECT *pRect, HRGN *pRegion);
  106. static HRESULT GetThemeBackgroundRegionFail(HTHEME hTheme, HDC hdc,
  107. int iPartId, int iStateId, const RECT *pRect, HRGN *pRegion)
  108. {return E_FAIL;}
  109. typedef HRESULT (__stdcall *PFNHITTESTTHEMEBACKGROUND)(HTHEME hTheme, HDC hdc, int iPartId,
  110. int iStateId, DWORD dwOptions, const RECT *pRect, HRGN hrgn,
  111. POINT ptTest, WORD *pwHitTestCode);
  112. static HRESULT HitTestThemeBackgroundFail(HTHEME hTheme, HDC hdc, int iPartId,
  113. int iStateId, DWORD dwOptions, const RECT *pRect, HRGN hrgn,
  114. POINT ptTest, WORD *pwHitTestCode)
  115. {return E_FAIL;}
  116. typedef HRESULT (__stdcall *PFNDRAWTHEMEEDGE)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId,
  117. const RECT *pDestRect, UINT uEdge, UINT uFlags, RECT *pContentRect);
  118. static HRESULT DrawThemeEdgeFail(HTHEME hTheme, HDC hdc, int iPartId, int iStateId,
  119. const RECT *pDestRect, UINT uEdge, UINT uFlags, RECT *pContentRect)
  120. {return E_FAIL;}
  121. typedef HRESULT (__stdcall *PFNDRAWTHEMEICON)(HTHEME hTheme, HDC hdc, int iPartId,
  122. int iStateId, const RECT *pRect, HIMAGELIST himl, int iImageIndex);
  123. static HRESULT DrawThemeIconFail(HTHEME hTheme, HDC hdc, int iPartId,
  124. int iStateId, const RECT *pRect, HIMAGELIST himl, int iImageIndex)
  125. {return E_FAIL;}
  126. typedef BOOL (__stdcall *PFNISTHEMEPARTDEFINED)(HTHEME hTheme, int iPartId,
  127. int iStateId);
  128. static BOOL IsThemePartDefinedFail(HTHEME hTheme, int iPartId,
  129. int iStateId)
  130. {return FALSE;}
  131. typedef BOOL (__stdcall *PFNISTHEMEBACKGROUNDPARTIALLYTRANSPARENT)(HTHEME hTheme,
  132. int iPartId, int iStateId);
  133. static BOOL IsThemeBackgroundPartiallyTransparentFail(HTHEME hTheme,
  134. int iPartId, int iStateId)
  135. {return FALSE;}
  136. typedef HRESULT (__stdcall *PFNGETTHEMECOLOR)(HTHEME hTheme, int iPartId,
  137. int iStateId, int iPropId, COLORREF *pColor);
  138. static HRESULT GetThemeColorFail(HTHEME hTheme, int iPartId,
  139. int iStateId, int iPropId, COLORREF *pColor)
  140. {return E_FAIL;}
  141. typedef HRESULT (__stdcall *PFNGETTHEMEMETRIC)(HTHEME hTheme, HDC hdc, int iPartId,
  142. int iStateId, int iPropId, int *piVal);
  143. static HRESULT GetThemeMetricFail(HTHEME hTheme, HDC hdc, int iPartId,
  144. int iStateId, int iPropId, int *piVal)
  145. {return E_FAIL;}
  146. typedef HRESULT (__stdcall *PFNGETTHEMESTRING)(HTHEME hTheme, int iPartId,
  147. int iStateId, int iPropId, LPWSTR pszBuff, int cchMaxBuffChars);
  148. static HRESULT GetThemeStringFail(HTHEME hTheme, int iPartId,
  149. int iStateId, int iPropId, LPWSTR pszBuff, int cchMaxBuffChars)
  150. {return E_FAIL;}
  151. typedef HRESULT (__stdcall *PFNGETTHEMEBOOL)(HTHEME hTheme, int iPartId,
  152. int iStateId, int iPropId, BOOL *pfVal);
  153. static HRESULT GetThemeBoolFail(HTHEME hTheme, int iPartId,
  154. int iStateId, int iPropId, BOOL *pfVal)
  155. {return E_FAIL;}
  156. typedef HRESULT (__stdcall *PFNGETTHEMEINT)(HTHEME hTheme, int iPartId,
  157. int iStateId, int iPropId, int *piVal);
  158. static HRESULT GetThemeIntFail(HTHEME hTheme, int iPartId,
  159. int iStateId, int iPropId, int *piVal)
  160. {return E_FAIL;}
  161. typedef HRESULT (__stdcall *PFNGETTHEMEENUMVALUE)(HTHEME hTheme, int iPartId,
  162. int iStateId, int iPropId, int *piVal);
  163. static HRESULT GetThemeEnumValueFail(HTHEME hTheme, int iPartId,
  164. int iStateId, int iPropId, int *piVal)
  165. {return E_FAIL;}
  166. typedef HRESULT (__stdcall *PFNGETTHEMEPOSITION)(HTHEME hTheme, int iPartId,
  167. int iStateId, int iPropId, POINT *pPoint);
  168. static HRESULT GetThemePositionFail(HTHEME hTheme, int iPartId,
  169. int iStateId, int iPropId, POINT *pPoint)
  170. {return E_FAIL;}
  171. typedef HRESULT (__stdcall *PFNGETTHEMEFONT)(HTHEME hTheme, HDC hdc, int iPartId,
  172. int iStateId, int iPropId, LOGFONT *pFont);
  173. static HRESULT GetThemeFontFail(HTHEME hTheme, HDC hdc, int iPartId,
  174. int iStateId, int iPropId, LOGFONT *pFont)
  175. {return E_FAIL;}
  176. typedef HRESULT (__stdcall *PFNGETTHEMERECT)(HTHEME hTheme, int iPartId,
  177. int iStateId, int iPropId, RECT *pRect);
  178. static HRESULT GetThemeRectFail(HTHEME hTheme, int iPartId,
  179. int iStateId, int iPropId, RECT *pRect)
  180. {return E_FAIL;}
  181. typedef HRESULT (__stdcall *PFNGETTHEMEMARGINS)(HTHEME hTheme, HDC hdc, int iPartId,
  182. int iStateId, int iPropId, RECT *prc, MARGINS *pMargins);
  183. static HRESULT GetThemeMarginsFail(HTHEME hTheme, HDC hdc, int iPartId,
  184. int iStateId, int iPropId, RECT *prc, MARGINS *pMargins)
  185. {return E_FAIL;}
  186. typedef HRESULT (__stdcall *PFNGETTHEMEINTLIST)(HTHEME hTheme, int iPartId,
  187. int iStateId, int iPropId, INTLIST *pIntList);
  188. static HRESULT GetThemeIntListFail(HTHEME hTheme, int iPartId,
  189. int iStateId, int iPropId, INTLIST *pIntList)
  190. {return E_FAIL;}
  191. typedef HRESULT (__stdcall *PFNGETTHEMEPROPERTYORIGIN)(HTHEME hTheme, int iPartId,
  192. int iStateId, int iPropId, enum PROPERTYORIGIN *pOrigin);
  193. static HRESULT GetThemePropertyOriginFail(HTHEME hTheme, int iPartId,
  194. int iStateId, int iPropId, enum PROPERTYORIGIN *pOrigin)
  195. {return E_FAIL;}
  196. typedef HRESULT (__stdcall *PFNSETWINDOWTHEME)(HWND hwnd, LPCWSTR pszSubAppName,
  197. LPCWSTR pszSubIdList);
  198. static HRESULT SetWindowThemeFail(HWND hwnd, LPCWSTR pszSubAppName,
  199. LPCWSTR pszSubIdList)
  200. {return E_FAIL;}
  201. typedef HRESULT (__stdcall *PFNGETTHEMEFILENAME)(HTHEME hTheme, int iPartId,
  202. int iStateId, int iPropId, LPWSTR pszThemeFileName, int cchMaxBuffChars);
  203. static HRESULT GetThemeFilenameFail(HTHEME hTheme, int iPartId,
  204. int iStateId, int iPropId, LPWSTR pszThemeFileName, int cchMaxBuffChars)
  205. {return E_FAIL;}
  206. typedef COLORREF (__stdcall *PFNGETTHEMESYSCOLOR)(HTHEME hTheme, int iColorId);
  207. static COLORREF GetThemeSysColorFail(HTHEME hTheme, int iColorId)
  208. {return RGB(255,255,255);}
  209. typedef HBRUSH (__stdcall *PFNGETTHEMESYSCOLORBRUSH)(HTHEME hTheme, int iColorId);
  210. static HBRUSH GetThemeSysColorBrushFail(HTHEME hTheme, int iColorId)
  211. {return NULL;}
  212. typedef BOOL (__stdcall *PFNGETTHEMESYSBOOL)(HTHEME hTheme, int iBoolId);
  213. static BOOL GetThemeSysBoolFail(HTHEME hTheme, int iBoolId)
  214. {return FALSE;}
  215. typedef int (__stdcall *PFNGETTHEMESYSSIZE)(HTHEME hTheme, int iSizeId);
  216. static int GetThemeSysSizeFail(HTHEME hTheme, int iSizeId)
  217. {return 0;}
  218. typedef HRESULT (__stdcall *PFNGETTHEMESYSFONT)(HTHEME hTheme, int iFontId, LOGFONT *plf);
  219. static HRESULT GetThemeSysFontFail(HTHEME hTheme, int iFontId, LOGFONT *plf)
  220. {return E_FAIL;}
  221. typedef HRESULT (__stdcall *PFNGETTHEMESYSSTRING)(HTHEME hTheme, int iStringId,
  222. LPWSTR pszStringBuff, int cchMaxStringChars);
  223. static HRESULT GetThemeSysStringFail(HTHEME hTheme, int iStringId,
  224. LPWSTR pszStringBuff, int cchMaxStringChars)
  225. {return E_FAIL;}
  226. typedef HRESULT (__stdcall *PFNGETTHEMESYSINT)(HTHEME hTheme, int iIntId, int *piValue);
  227. static HRESULT GetThemeSysIntFail(HTHEME hTheme, int iIntId, int *piValue)
  228. {return E_FAIL;}
  229. typedef BOOL (__stdcall *PFNISTHEMEACTIVE)();
  230. static BOOL IsThemeActiveFail()
  231. {return FALSE;}
  232. typedef BOOL(__stdcall *PFNISAPPTHEMED)();
  233. static BOOL IsAppThemedFail()
  234. {return FALSE;}
  235. typedef HTHEME (__stdcall *PFNGETWINDOWTHEME)(HWND hwnd);
  236. static HTHEME GetWindowThemeFail(HWND hwnd)
  237. {return NULL;}
  238. typedef HRESULT (__stdcall *PFNENABLETHEMEDIALOGTEXTURE)(HWND hwnd, DWORD dwFlags);
  239. static HRESULT EnableThemeDialogTextureFail(HWND hwnd, DWORD dwFlags)
  240. {return E_FAIL;}
  241. typedef BOOL (__stdcall *PFNISTHEMEDIALOGTEXTUREENABLED)(HWND hwnd);
  242. static BOOL IsThemeDialogTextureEnabledFail(HWND hwnd)
  243. {return FALSE;}
  244. typedef DWORD (__stdcall *PFNGETTHEMEAPPPROPERTIES)();
  245. static DWORD GetThemeAppPropertiesFail()
  246. {return 0;}
  247. typedef void (__stdcall *PFNSETTHEMEAPPPROPERTIES)(DWORD dwFlags);
  248. static void SetThemeAppPropertiesFail(DWORD dwFlags)
  249. {return;}
  250. typedef HRESULT (__stdcall *PFNGETCURRENTTHEMENAME)(
  251. LPWSTR pszThemeFileName, int cchMaxNameChars,
  252. LPWSTR pszColorBuff, int cchMaxColorChars,
  253. LPWSTR pszSizeBuff, int cchMaxSizeChars);
  254. static HRESULT GetCurrentThemeNameFail(
  255. LPWSTR pszThemeFileName, int cchMaxNameChars,
  256. LPWSTR pszColorBuff, int cchMaxColorChars,
  257. LPWSTR pszSizeBuff, int cchMaxSizeChars)
  258. {return E_FAIL;}
  259. typedef HRESULT (__stdcall *PFNGETTHEMEDOCUMENTATIONPROPERTY)(LPCWSTR pszThemeName,
  260. LPCWSTR pszPropertyName, LPWSTR pszValueBuff, int cchMaxValChars);
  261. static HRESULT GetThemeDocumentationPropertyFail(LPCWSTR pszThemeName,
  262. LPCWSTR pszPropertyName, LPWSTR pszValueBuff, int cchMaxValChars)
  263. {return E_FAIL;}
  264. typedef HRESULT (__stdcall *PFNDRAWTHEMEPARENTBACKGROUND)(HWND hwnd, HDC hdc, RECT* prc);
  265. static HRESULT DrawThemeParentBackgroundFail(HWND hwnd, HDC hdc, RECT* prc)
  266. {return E_FAIL;}
  267. typedef HRESULT (__stdcall *PFNENABLETHEMING)(BOOL fEnable);
  268. static HRESULT EnableThemingFail(BOOL fEnable)
  269. {return E_FAIL;}
  270. public:
  271. HTHEME OpenThemeData(HWND hwnd, LPCWSTR pszClassList);
  272. HRESULT CloseThemeData(HTHEME hTheme);
  273. HRESULT DrawThemeBackground(HTHEME hTheme, HDC hdc,
  274. int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect);
  275. HRESULT DrawThemeText(HTHEME hTheme, HDC hdc, int iPartId,
  276. int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags,
  277. DWORD dwTextFlags2, const RECT *pRect);
  278. HRESULT GetThemeBackgroundContentRect(HTHEME hTheme, HDC hdc,
  279. int iPartId, int iStateId, const RECT *pBoundingRect,
  280. RECT *pContentRect);
  281. HRESULT GetThemeBackgroundExtent(HTHEME hTheme, HDC hdc,
  282. int iPartId, int iStateId, const RECT *pContentRect,
  283. RECT *pExtentRect);
  284. HRESULT GetThemePartSize(HTHEME hTheme, HDC hdc,
  285. int iPartId, int iStateId, RECT * pRect, enum THEMESIZE eSize, SIZE *psz);
  286. HRESULT GetThemeTextExtent(HTHEME hTheme, HDC hdc,
  287. int iPartId, int iStateId, LPCWSTR pszText, int iCharCount,
  288. DWORD dwTextFlags, const RECT *pBoundingRect,
  289. RECT *pExtentRect);
  290. HRESULT GetThemeTextMetrics(HTHEME hTheme, HDC hdc,
  291. int iPartId, int iStateId, TEXTMETRIC* ptm);
  292. HRESULT GetThemeBackgroundRegion(HTHEME hTheme, HDC hdc,
  293. int iPartId, int iStateId, const RECT *pRect, HRGN *pRegion);
  294. HRESULT HitTestThemeBackground(HTHEME hTheme, HDC hdc, int iPartId,
  295. int iStateId, DWORD dwOptions, const RECT *pRect, HRGN hrgn,
  296. POINT ptTest, WORD *pwHitTestCode);
  297. HRESULT DrawThemeEdge(HTHEME hTheme, HDC hdc, int iPartId, int iStateId,
  298. const RECT *pDestRect, UINT uEdge, UINT uFlags, RECT *pContentRect);
  299. HRESULT DrawThemeIcon(HTHEME hTheme, HDC hdc, int iPartId,
  300. int iStateId, const RECT *pRect, HIMAGELIST himl, int iImageIndex);
  301. BOOL IsThemePartDefined(HTHEME hTheme, int iPartId,
  302. int iStateId);
  303. BOOL IsThemeBackgroundPartiallyTransparent(HTHEME hTheme,
  304. int iPartId, int iStateId);
  305. HRESULT GetThemeColor(HTHEME hTheme, int iPartId,
  306. int iStateId, int iPropId, COLORREF *pColor);
  307. HRESULT GetThemeMetric(HTHEME hTheme, HDC hdc, int iPartId,
  308. int iStateId, int iPropId, int *piVal);
  309. HRESULT GetThemeString(HTHEME hTheme, int iPartId,
  310. int iStateId, int iPropId, LPWSTR pszBuff, int cchMaxBuffChars);
  311. HRESULT GetThemeBool(HTHEME hTheme, int iPartId,
  312. int iStateId, int iPropId, BOOL *pfVal);
  313. HRESULT GetThemeInt(HTHEME hTheme, int iPartId,
  314. int iStateId, int iPropId, int *piVal);
  315. HRESULT GetThemeEnumValue(HTHEME hTheme, int iPartId,
  316. int iStateId, int iPropId, int *piVal);
  317. HRESULT GetThemePosition(HTHEME hTheme, int iPartId,
  318. int iStateId, int iPropId, POINT *pPoint);
  319. HRESULT GetThemeFont(HTHEME hTheme, HDC hdc, int iPartId,
  320. int iStateId, int iPropId, LOGFONT *pFont);
  321. HRESULT GetThemeRect(HTHEME hTheme, int iPartId,
  322. int iStateId, int iPropId, RECT *pRect);
  323. HRESULT GetThemeMargins(HTHEME hTheme, HDC hdc, int iPartId,
  324. int iStateId, int iPropId, RECT *prc, MARGINS *pMargins);
  325. HRESULT GetThemeIntList(HTHEME hTheme, int iPartId,
  326. int iStateId, int iPropId, INTLIST *pIntList);
  327. HRESULT GetThemePropertyOrigin(HTHEME hTheme, int iPartId,
  328. int iStateId, int iPropId, enum PROPERTYORIGIN *pOrigin);
  329. HRESULT SetWindowTheme(HWND hwnd, LPCWSTR pszSubAppName,
  330. LPCWSTR pszSubIdList);
  331. HRESULT GetThemeFilename(HTHEME hTheme, int iPartId,
  332. int iStateId, int iPropId, LPWSTR pszThemeFileName, int cchMaxBuffChars);
  333. COLORREF GetThemeSysColor(HTHEME hTheme, int iColorId);
  334. HBRUSH GetThemeSysColorBrush(HTHEME hTheme, int iColorId);
  335. BOOL GetThemeSysBool(HTHEME hTheme, int iBoolId);
  336. int GetThemeSysSize(HTHEME hTheme, int iSizeId);
  337. HRESULT GetThemeSysFont(HTHEME hTheme, int iFontId, LOGFONT *plf);
  338. HRESULT GetThemeSysString(HTHEME hTheme, int iStringId,
  339. LPWSTR pszStringBuff, int cchMaxStringChars);
  340. HRESULT GetThemeSysInt(HTHEME hTheme, int iIntId, int *piValue);
  341. BOOL IsThemeActive();
  342. BOOL IsAppThemed();
  343. HTHEME GetWindowTheme(HWND hwnd);
  344. HRESULT EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags);
  345. BOOL IsThemeDialogTextureEnabled(HWND hwnd);
  346. DWORD GetThemeAppProperties();
  347. void SetThemeAppProperties(DWORD dwFlags);
  348. HRESULT GetCurrentThemeName(
  349. LPWSTR pszThemeFileName, int cchMaxNameChars,
  350. LPWSTR pszColorBuff, int cchMaxColorChars,
  351. LPWSTR pszSizeBuff, int cchMaxSizeChars);
  352. HRESULT GetThemeDocumentationProperty(LPCWSTR pszThemeName,
  353. LPCWSTR pszPropertyName, LPWSTR pszValueBuff, int cchMaxValChars);
  354. HRESULT DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT* prc);
  355. HRESULT EnableTheming(BOOL fEnable);
  356. public:
  357. CVisualStylesXP(void);
  358. ~CVisualStylesXP(void);
  359. BOOL UseVisualStyles(); // Added by Mathias Tunared 2002-07-27
  360. };
  361. extern CVisualStylesXP g_xpStyle;
  362. #pragma warning(pop)
  363. #endif