1 #ifndef _UXTHEME_H 2 #define _UXTHEME_H 3 4 #include <commctrl.h> 5 6 #ifdef __cplusplus 7 extern "C" { 8 #endif 9 10 #if (_WIN32_WINNT >= 0x0501) 11 #define DTBG_CLIPRECT 0x00000001 12 #define DTBG_DRAWSOLID 0x00000002 13 #define DTBG_OMITBORDER 0x00000004 14 #define DTBG_OMITCONTENT 0x00000008 15 #define DTBG_COMPUTINGREGION 0x00000010 16 #define DTBG_MIRRORDC 0x00000020 17 #define DTT_GRAYED 0x00000001 18 19 /* DTTOPTS.dwFlags bits */ 20 #define DTT_TEXTCOLOR 0x00000001 21 #define DTT_BORDERCOLOR 0x00000002 22 #define DTT_SHADOWCOLOR 0x00000004 23 #define DTT_SHADOWTYPE 0x00000008 24 #define DTT_SHADOWOFFSET 0x00000010 25 #define DTT_BORDERSIZE 0x00000020 26 #define DTT_FONTPROP 0x00000040 27 #define DTT_COLORPROP 0x00000080 28 #define DTT_STATEID 0x00000100 29 #define DTT_CALCRECT 0x00000200 30 #define DTT_APPLYOVERLAY 0x00000400 31 #define DTT_GLOWSIZE 0x00000800 32 #define DTT_CALLBACK 0x00001000 33 #define DTT_COMPOSITED 0x00002000 34 #define DTT_VALIDBITS 0x00003fff 35 36 #define ETDT_DISABLE 0x00000001 37 #define ETDT_ENABLE 0x00000002 38 #define ETDT_USETABTEXTURE 0x00000004 39 #define ETDT_ENABLETAB (ETDT_ENABLE | ETDT_USETABTEXTURE) 40 #define STAP_ALLOW_NONCLIENT 0x00000001 41 #define STAP_ALLOW_CONTROLS 0x00000002 42 #define STAP_ALLOW_WEBCONTENT 0x00000004 43 #define HTTB_BACKGROUNDSEG 0x0000 44 #define HTTB_FIXEDBORDER 0x0002 45 #define HTTB_CAPTION 0x0004 46 #define HTTB_RESIZINGBORDER_LEFT 0x0010 47 #define HTTB_RESIZINGBORDER_TOP 0x0020 48 #define HTTB_RESIZINGBORDER_RIGHT 0x0040 49 #define HTTB_RESIZINGBORDER_BOTTOM 0x0080 50 #define HTTB_RESIZINGBORDER (HTTB_RESIZINGBORDER_LEFT|HTTB_RESIZINGBORDER_TOP|HTTB_RESIZINGBORDER_RIGHT|HTTB_RESIZINGBORDER_BOTTOM) 51 #define HTTB_SIZINGTEMPLATE 0x0100 52 #define HTTB_SYSTEMSIZINGMARGINS 0x0200 53 54 #define OTD_FORCE_RECT_SIZING 0x0001 55 #define OTD_NONCLIENT 0x0002 56 #define OTD_VALIDBITS (OTD_FORCE_RECT_SIZING | OTD_NONCLIENT) 57 58 typedef HANDLE HPAINTBUFFER; 59 typedef HANDLE HTHEME; 60 typedef int (WINAPI *DTT_CALLBACK_PROC)(HDC,LPWSTR,int,RECT*,UINT,LPARAM); 61 62 typedef enum _BP_BUFFERFORMAT 63 { 64 BPBF_COMPATIBLEBITMAP, 65 BPBF_DIB, 66 BPBF_TOPDOWNDIB, 67 BPBF_TOPDOWNMONODIB 68 } BP_BUFFERFORMAT; 69 70 typedef struct _BP_PAINTPARAMS 71 { 72 DWORD cbSize; 73 DWORD dwFlags; 74 const RECT *prcExclude; 75 const BLENDFUNCTION *pBlendFunction; 76 } BP_PAINTPARAMS, *PBP_PAINTPARAMS; 77 78 typedef enum PROPERTYORIGIN { 79 PO_STATE = 0, 80 PO_PART = 1, 81 PO_CLASS = 2, 82 PO_GLOBAL = 3, 83 PO_NOTFOUND = 4 84 } PROPERTYORIGIN; 85 86 typedef enum THEMESIZE { 87 TS_MIN, 88 TS_TRUE, 89 TS_DRAW 90 } THEMESIZE; 91 92 typedef struct _DTBGOPTS { 93 DWORD dwSize; 94 DWORD dwFlags; 95 RECT rcClip; 96 } DTBGOPTS, *PDTBGOPTS; 97 98 #define MAX_INTLIST_COUNT 10 99 100 typedef struct _INTLIST { 101 int iValueCount; 102 int iValues[MAX_INTLIST_COUNT]; 103 } INTLIST, *PINTLIST; 104 105 typedef struct _MARGINS { 106 int cxLeftWidth; 107 int cxRightWidth; 108 int cyTopHeight; 109 int cyBottomHeight; 110 } MARGINS, *PMARGINS; 111 112 typedef struct _DTTOPTS { 113 DWORD dwSize; 114 DWORD dwFlags; 115 COLORREF crText; 116 COLORREF crBorder; 117 COLORREF crShadow; 118 int iTextShadowType; 119 POINT ptShadowOffset; 120 int iBorderSize; 121 int iFontPropId; 122 int iColorPropId; 123 int iStateId; 124 BOOL fApplyOverlay; 125 int iGlowSize; 126 DTT_CALLBACK_PROC pfnDrawTextCallback; 127 LPARAM lParam; 128 } DTTOPTS, *PDTTOPTS; 129 130 HRESULT WINAPI CloseThemeData(HTHEME); 131 HRESULT WINAPI DrawThemeBackground(HTHEME,HDC,int,int,const RECT*,const RECT*); 132 HRESULT WINAPI DrawThemeBackgroundEx(HTHEME,HDC,int,int,const RECT*,const DTBGOPTS*); 133 HRESULT WINAPI DrawThemeEdge(HTHEME,HDC,int,int,const RECT*,UINT,UINT,RECT*); 134 HRESULT WINAPI DrawThemeIcon(HTHEME,HDC,int,int,const RECT*,HIMAGELIST,int); 135 HRESULT WINAPI DrawThemeParentBackground(HWND,HDC,RECT*); 136 HRESULT WINAPI DrawThemeText(HTHEME,HDC,int,int,LPCWSTR,int,DWORD,DWORD,const RECT*); 137 HRESULT WINAPI EnableThemeDialogTexture(HWND,DWORD); 138 HRESULT WINAPI EnableTheming(BOOL); 139 HRESULT WINAPI GetCurrentThemeName(LPWSTR,int,LPWSTR,int,LPWSTR,int); 140 DWORD WINAPI GetThemeAppProperties(void); 141 HRESULT WINAPI GetThemeBackgroundContentRect(HTHEME,HDC,int,int,const RECT*,RECT*); 142 HRESULT WINAPI GetThemeBackgroundExtent(HTHEME,HDC,int,int,const RECT*,RECT*); 143 HRESULT WINAPI GetThemeBackgroundRegion(HTHEME,HDC,int,int,const RECT*,HRGN*); 144 HRESULT WINAPI GetThemeBool(HTHEME,int,int,int,BOOL*); 145 HRESULT WINAPI GetThemeColor(HTHEME,int,int,int,COLORREF*); 146 HRESULT WINAPI GetThemeDocumentationProperty(LPCWSTR,LPCWSTR,LPWSTR,int); 147 HRESULT WINAPI GetThemeEnumValue(HTHEME,int,int,int,int*); 148 HRESULT WINAPI GetThemeFilename(HTHEME,int,int,int,LPWSTR,int); 149 HRESULT WINAPI GetThemeFont(HTHEME,HDC,int,int,int,LOGFONTW*); 150 HRESULT WINAPI GetThemeInt(HTHEME,int,int,int,int*); 151 HRESULT WINAPI GetThemeIntList(HTHEME,int,int,int,INTLIST*); 152 HRESULT WINAPI GetThemeMargins(HTHEME,HDC,int,int,int,RECT*,MARGINS*); 153 HRESULT WINAPI GetThemeMetric(HTHEME,HDC,int,int,int,int*); 154 HRESULT WINAPI GetThemePartSize(HTHEME,HDC,int,int,RECT*,THEMESIZE,SIZE*); 155 HRESULT WINAPI GetThemePosition(HTHEME,int,int,int,POINT*); 156 HRESULT WINAPI GetThemePropertyOrigin(HTHEME,int,int,int,PROPERTYORIGIN*); 157 HRESULT WINAPI GetThemeRect(HTHEME,int,int,int,RECT*); 158 HRESULT WINAPI GetThemeString(HTHEME,int,int,int,LPWSTR,int); 159 BOOL WINAPI GetThemeSysBool(HTHEME,int); 160 COLORREF WINAPI GetThemeSysColor(HTHEME,int); 161 HBRUSH WINAPI GetThemeSysColorBrush(HTHEME,int); 162 HRESULT WINAPI GetThemeSysFont(HTHEME,int,LOGFONTW*); 163 HRESULT WINAPI GetThemeSysInt(HTHEME,int,int*); 164 int WINAPI GetThemeSysSize(HTHEME,int); 165 HRESULT WINAPI GetThemeSysString(HTHEME,int,LPWSTR,int); 166 HRESULT WINAPI GetThemeTextExtent(HTHEME,HDC,int,int,LPCWSTR,int,DWORD,const RECT*,RECT*); 167 HRESULT WINAPI GetThemeTextMetrics(HTHEME,HDC,int,int,TEXTMETRICW*); 168 HTHEME WINAPI GetWindowTheme(HWND); 169 HRESULT WINAPI HitTestThemeBackground(HTHEME,HDC,int,int,DWORD,const RECT*,HRGN,POINT,WORD*); 170 BOOL WINAPI IsAppThemed(void); 171 BOOL WINAPI IsThemeActive(void); 172 BOOL WINAPI IsThemeBackgroundPartiallyTransparent(HTHEME,int,int); 173 BOOL WINAPI IsThemeDialogTextureEnabled(HWND); 174 BOOL WINAPI IsThemePartDefined(HTHEME,int,int); 175 HTHEME WINAPI OpenThemeData(HWND,LPCWSTR); 176 HTHEME WINAPI OpenThemeDataEx(HWND,LPCWSTR,DWORD); 177 void WINAPI SetThemeAppProperties(DWORD); 178 HRESULT WINAPI SetWindowTheme(HWND,LPCWSTR,LPCWSTR); 179 180 /* Undocumented and not exported in Windows XP/2003 181 * In public headers since Vista+ */ 182 HRESULT 183 WINAPI 184 DrawThemeTextEx( 185 _In_ HTHEME hTheme, 186 _In_ HDC hdc, 187 _In_ int iPartId, 188 _In_ int iStateId, 189 _In_ LPCWSTR pszText, 190 _In_ int iCharCount, 191 _In_ DWORD dwTextFlags, 192 _Inout_ LPRECT pRect, 193 _In_ const DTTOPTS *options 194 ); 195 #endif 196 197 #ifdef __cplusplus 198 } 199 #endif 200 #endif 201