00001
00002
00003
00004
00005
00006 #if !defined(AFX_VMSTHEME_H__099DAAAB_05C7_4633_A4D8_0F6ACA94284F__INCLUDED_)
00007 #define AFX_VMSTHEME_H__099DAAAB_05C7_4633_A4D8_0F6ACA94284F__INCLUDED_
00008
00009 #if _MSC_VER > 1000
00010 #pragma once
00011 #endif
00012
00013 #ifndef HTHEME
00014 typedef HANDLE HTHEME;
00015 #endif
00016
00017 typedef HTHEME (WINAPI *fntOpenThemeData)(HWND hwnd,LPCWSTR pszClassList);
00018 typedef HRESULT (WINAPI *fntDrawThemeBackground)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect);
00019 typedef HRESULT (WINAPI *fntCloseThemeData)(HTHEME hTheme);
00020 typedef BOOL (WINAPI* fntIsThemeActive)();
00021 typedef HRESULT (WINAPI *fntSetWindowTheme)(HWND, LPCWSTR, LPCWSTR);
00022
00023 #define TBMF_PAD 0x00000001
00024 #define TBMF_BARPAD 0x00000002
00025 #define TBMF_BUTTONSPACING 0x00000004
00026
00027 typedef struct {
00028 UINT cbSize;
00029 DWORD dwMask;
00030
00031 int cxPad;
00032 int cyPad;
00033 int cxBarPad;
00034 int cyBarPad;
00035 int cxButtonSpacing;
00036 int cyButtonSpacing;
00037 } TBMETRICS, * LPTBMETRICS;
00038
00039 #define TB_GETMETRICS (WM_USER + 101)
00040 #define TB_SETMETRICS (WM_USER + 102)
00041
00042 class vmsTheme
00043 {
00044 public:
00045 HRESULT SetWindowTheme (HWND hwnd, LPCWSTR pszSubAppName, LPCWSTR pszSubIdList);
00046 BOOL IsThemeActive();
00047 HRESULT CloseThemeData(HTHEME hTheme);
00048 HRESULT DrawThemeBackground (HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect);
00049 HTHEME OpenThemeData (HWND hwnd, LPCWSTR pszClassList);
00050 vmsTheme();
00051 virtual ~vmsTheme();
00052
00053 protected:
00054 HMODULE m_hThemeDLL;
00055 fntOpenThemeData m_pfnOpenThemeData;
00056 fntDrawThemeBackground m_pfnDrawThemeBackground;
00057 fntCloseThemeData m_pfnCloseThemeData;
00058 fntIsThemeActive m_pfnIsThemeActive;
00059 fntSetWindowTheme m_pfnSetWindowTheme;
00060 };
00061
00062 #endif