From a18042e77f777efae2d3732758bbc7f3cd867c4f Mon Sep 17 00:00:00 2001 From: Frank Richter Date: Tue, 30 Aug 2005 09:58:41 +0000 Subject: [PATCH] More elaborate IsThemeBackgroundPartiallyTransparent() implementation; also returns TRUE for theme parts with 32bpp images. --- dlls/uxtheme/draw.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/dlls/uxtheme/draw.c b/dlls/uxtheme/draw.c index df28a1eee78..1a80f6d4db3 100644 --- a/dlls/uxtheme/draw.c +++ b/dlls/uxtheme/draw.c @@ -1849,8 +1849,28 @@ HRESULT WINAPI GetThemeTextMetrics(HTHEME hTheme, HDC hdc, int iPartId, BOOL WINAPI IsThemeBackgroundPartiallyTransparent(HTHEME hTheme, int iPartId, int iStateId) { - BOOL transparent = FALSE; + int bgtype = BT_BORDERFILL; + RECT rect = {0, 0, 0, 0}; + HBITMAP bmpSrc; + RECT rcSrc; + BOOL hasAlpha; + INT transparent; + COLORREF transparentcolor; + TRACE("(%d,%d)\n", iPartId, iStateId); - GetThemeBool(hTheme, iPartId, iStateId, TMT_TRANSPARENT, &transparent); - return transparent; + + if(!hTheme) + return FALSE; + + GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_BGTYPE, &bgtype); + + if (bgtype != BT_IMAGEFILE) return FALSE; + + if(FAILED (UXTHEME_LoadImage (hTheme, 0, iPartId, iStateId, &rect, FALSE, + &bmpSrc, &rcSrc, &hasAlpha))) + return FALSE; + + get_transparency (hTheme, iPartId, iStateId, hasAlpha, &transparent, + &transparentcolor, FALSE); + return (transparent != ALPHABLEND_NONE); }