// uxtheme.h for D // required: windows.h for D // とりあえず手書き…。 private import win32.commctrl; import tmschema; typedef HANDLE HTHEME; extern(Windows) export HTHEME OpenThemeData(HWND hwnd, LPCWSTR pszClassList); extern(Windows) export HRESULT CloseThemeData(HTHEME hTheme); extern(Windows) export HRESULT DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT* pRect, RECT* pClipRect); enum { DTT_GRAYED = 0x1, } extern(Windows) export HRESULT DrawThemeText(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, DWORD dwTextFlags2, RECT* pRect); extern(Windows) export HRESULT GetThemeBackgroundContentRect(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT* pBoundingRect, RECT* pContentRect); extern(Windows) export HRESULT GetThemeBackgroundExtent(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT* pContentRect, RECT* pExtentRect); enum THEMESIZE { TS_MIN, TS_TRUE, TS_DRAW } extern(Windows) export HRESULT GetThemePartSize(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT* prc, THEMESIZE eSize, SIZE* psz); extern(Windows) export HRESULT GetThemeTextExtent(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR lszText, int iCharCount, DWORD dwTextFlags, RECT* pBoundingRect, RECT* pExtentRect); extern(Windows) export HRESULT GetThemeTextMetrics(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, TEXTMETRIC* ptm); extern(Windows) export HRESULT GetThemeBackgroundRegion(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT* pRect, HRGN* pRegion); enum { HTTB_BACKGROUNDSEG = 0x0000, HTTB_FIXEDBORDER = 0x0002, HTTB_CAPTION = 0x0004, HTTB_RESIZINGBORDER_LEFT = 0x0010, HTTB_RESIZINGBORDER_TOP = 0x0020, HTTB_RESIZINGBORDER_RIGHT = 0x0010, HTTB_RESIZINGBORDER_BOTTOM = 0x0020, HTTB_RESIZINGBORDER = HTTB_RESIZINGBORDER_LEFT | HTTB_RESIZINGBORDER_TOP | HTTB_RESIZINGBORDER_RIGHT | HTTB_RESIZINGBORDER_BOTTOM, HTTB_SIZINGTEMPLATE = 0x0100, HTTB_SYSTEMSIZINGMARGINS = 0x0200, } extern(Windows) export HRESULT HitTestThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, DWORD dwOptions, RECT* pRect, HRGN hrgn, POINT ptTest, WORD* pwHitTestCode); extern(Windows) export HRESULT DrawThemeEdge(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT* pDestRect, UINT uEdge, UINT uFlags, RECT* pContentRect); extern(Windows) export HRESULT DrawThemeIcon(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT* pRect, HIMAGELIST himl, int iImageIndex); extern(Windows) export BOOL IsThemePartDefined(HTHEME hTheme, int iPartId, int iStateId); extern(Windows) export BOOL IsThemeBackgroundPartiallyTransparent(HTHEME hTheme, int iPartId, int iStateId); extern(Windows) export HRESULT GetThemeColor(HTHEME hTheme, int iPartId, int iStateId, int iPropId, COLORREF* pColor); extern(Windows) export HRESULT GetThemeMetric(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, int* piVal); extern(Windows) export HRESULT GetThemeString(HTHEME hTheme, int iPartId, int iStateId, int iPropId, LPWSTR pszBuff, int cchMaxBuffChars); extern(Windows) export HRESULT GetThemeBool(HTHEME hTheme, int iPartId, int iStateId, int ipropId, BOOL* pfVal); extern(Windows) export HRESULT GetThemeInt(HTHEME hTheme, int iPartId, int iStateId, int iPropId, int* piVal); extern(Windows) export HRESULT GetThemeEnumValue(HTHEME hTheme, int iPartId, int iStateId, int iPropId, int* piVal); extern(Windows) export HRESULT GetThemePosition(HTHEME hTheme, int iPartId, int iStateId, int iPropId, POINT* pPoint); extern(Windows) export HRESULT GetThemeFont(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, LOGFONT* pFont); extern(Windows) export HRESULT GetThemeRect(HTHEME hTheme, int iPartId, int iStateId, int iPropId, RECT* pRect); struct MARGINS { int cxLeftWidth; int cxRightWidth; int cyTopHeight; int cyBottomHeight; } extern(Windows) export HRESULT GetThemeMargins(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, RECT* prc, MARGINS* pMargins); enum { MAX_INTLIST_COUNT = 10, } struct INTLIST { int iValueCount; int iValues[MAX_INTLIST_COUNT]; } extern(Windows) export HRESULT GetThemeIntList(HTHEME hTheme, int iPartId, int iStateId, int iPropId, INTLIST* pIntList); enum PROPERTYORIGIN { PO_STATE, PO_PART, PO_CLASS, PO_NOTFOUND } extern(Windows) export HRESULT GetThemePropertyOrigin(HTHEME hTheme, int iPartId, int iStateId, int iPropId, PROPERTYORIGIN* pOrigin); extern(Windows) export HRESULT SetWindowTheme(HWND hwnd, LPCWSTR pszSubAppName, LPCWSTR pszSubIdList); extern(Windows) export HRESULT GetThemeFilename(HTHEME hTheme, int iPartId, int iStateId, int iPropId, LPWSTR pszThemeFileName, int cchMaxBuffChars); extern(Windows) export COLORREF GetThemeSysColor(HTHEME hTheme, int iColorId); extern(Windows) export HBRUSH GetThemeSysColorBrush(HTHEME hTheme, int iColorId); extern(Windows) export BOOL GetThemeSysBool(HTHEME hTheme, int iBoolId); extern(Windows) export int GetThemeSysSize(HTHEME hTheme, int iSizeId); extern(Windows) export HRESULT GetThemeSysFont(HTHEME hTheme, int iFontId, LOGFONT* plf); extern(Windows) export HRESULT GetThemeSysString(HTHEME hTheme, int iStringId, LPWSTR pszStringBuff, int cchMaxStringChars); extern(Windows) export HRESULT GetThemeSysInt(HTHEME hTheme, int iIntId, int* piVal); extern(Windows) export BOOL IsThemeActive(); extern(Windows) export BOOL IsAppThemed(); extern(Windows) export HTHEME GetWindowTheme(HWND hwnd); enum { ETDT_DISABLE = 0x00000001, ETDT_ENABLE = 0x00000002, ETDT_USETABTEXTURE = 0x00000004, ETDT_ENABLETAB = ETDT_ENABLE | ETDT_USETABTEXTURE, } extern(Windows) export HRESULT EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags); extern(Windows) export BOOL IsThemeDialogTextureEnabled(HWND hwnd); enum { STAP_ALLOW_NONCLIENT = (1 << 0), STAP_ALLOW_CONTROLS = (1 << 1), STAP_ALLOW_WEBCONTENT = (1 << 2), } extern(Windows) export DWORD GetThemeAppProperties(); extern(Windows) export void SetThemeAppProperties(DWORD dwFlags); extern(Windows) export HRESULT GetCurrentThemeName( LPWSTR pszThemeFileName, int cchMaxNameChars, LPWSTR pszColorBuff, int cchMaxNameChars, LPWSTR oszSizeBuff, int cchMaxSizeChars); /* enum { SZ_THDOCPROP_DISPLAYNAME = "DisplayName", SZ_THDOCPROP_CANONICALNAME = "ThemeName", SZ_THDOCPROP_TOOLTIP = "Tooltip", SZ_THDOCPROP_AUTHOR = "author" } */ LPWSTR SZ_THDOCPROP_DISPLAYNAME = "DisplayName\0"; LPWSTR SZ_THDOCPROP_CANONICALNAME = "ThemeName\0"; LPWSTR SZ_THDOCPROP_TOOLTIP = "Tooltip\0"; LPWSTR SZ_THDOCPROP_AUTHOR = "author\0"; extern(Windows) export HRESULT GetThemeDocumentationProperty(LPCWSTR pszThemeName, LPCWSTR pszPropertyName, LPWSTR pszValueBuff, int cchMaxValueChars); extern(Windows) export HRESULT DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT* prc); extern(Windows) export HRESULT EnableTheming(BOOL fEnable); enum { DTBG_CLIPRECT = 0x00000001, DTBG_DRAWSOLID = 0x00000002, DTBG_OMITBORDER = 0x00000004, DTBG_OMITCONTENT = 0x00000008, DTBG_COMPUTINGREGION = 0x00000010, DTBG_MIRRORDC = 0x00000020, } struct DTBGOPTS { DWORD dwSize; DWORD dwFlags; RECT rcClip; } extern(Windows) export HRESULT DrawThemeBackgroundEx(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT* pRect, DTBGOPTS* pOptions);