From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/comctl32/ipaddress.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-)
diff --git a/dlls/comctl32/ipaddress.c b/dlls/comctl32/ipaddress.c index af1ae11300e..2e99039e6d3 100644 --- a/dlls/comctl32/ipaddress.c +++ b/dlls/comctl32/ipaddress.c @@ -35,9 +35,11 @@ #include "winnls.h" #include "commctrl.h" #include "comctl32.h" +#if __WINE_COMCTL32_VERSION == 6 #include "uxtheme.h" #include "vsstyle.h" #include "vssym32.h" +#endif #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(ipaddress); @@ -138,15 +140,18 @@ static LRESULT IPADDRESS_Draw (const IPADDRESS_INFO *infoPtr, HDC hdc) { RECT rect, rcPart; COLORREF bgCol, fgCol; + int i; +#if __WINE_COMCTL32_VERSION == 6 HTHEME theme; - int i, state = ETS_NORMAL; + int state = ETS_NORMAL; +#endif
TRACE("\n");
GetClientRect (infoPtr->Self, &rect);
+#if __WINE_COMCTL32_VERSION == 6 theme = GetWindowTheme (infoPtr->Self); - if (theme) { DWORD dwStyle = GetWindowLongW (infoPtr->Self, GWL_STYLE);
@@ -163,7 +168,10 @@ static LRESULT IPADDRESS_Draw (const IPADDRESS_INFO *infoPtr, HDC hdc) if (IsThemeBackgroundPartiallyTransparent (theme, EP_EDITTEXT, state)) DrawThemeParentBackground(infoPtr->Self, hdc, &rect); DrawThemeBackground (theme, hdc, EP_EDITTEXT, state, &rect, 0); - } else { + } + else +#endif + { if (infoPtr->Enabled) { bgCol = comctl32_color.clrWindow; fgCol = comctl32_color.clrWindowText; @@ -187,9 +195,11 @@ static LRESULT IPADDRESS_Draw (const IPADDRESS_INFO *infoPtr, HDC hdc) MapWindowPoints( 0, infoPtr->Self, (POINT *)&rcPart, 2 ); rect.right = rcPart.left;
+#if __WINE_COMCTL32_VERSION == 6 if (theme) DrawThemeText(theme, hdc, EP_EDITTEXT, state, L".", 1, DT_SINGLELINE | DT_CENTER | DT_BOTTOM, 0, &rect); else +#endif DrawTextW(hdc, L".", 1, &rect, DT_SINGLELINE | DT_CENTER | DT_BOTTOM); }
@@ -252,7 +262,9 @@ static LRESULT IPADDRESS_Create (HWND hwnd, const CREATESTRUCTA *lpCreate) }
IPADDRESS_UpdateText (infoPtr); +#if __WINE_COMCTL32_VERSION == 6 OpenThemeData (infoPtr->Self, WC_EDITW); +#endif
return 0; } @@ -260,7 +272,6 @@ static LRESULT IPADDRESS_Create (HWND hwnd, const CREATESTRUCTA *lpCreate)
static LRESULT IPADDRESS_Destroy (IPADDRESS_INFO *infoPtr) { - HTHEME theme; int i;
TRACE("\n"); @@ -273,8 +284,9 @@ static LRESULT IPADDRESS_Destroy (IPADDRESS_INFO *infoPtr) if (infoPtr->hFont) DeleteObject (infoPtr->hFont); SetWindowLongPtrW (infoPtr->Self, 0, 0); - theme = GetWindowTheme (infoPtr->Self); - CloseThemeData (theme); +#if __WINE_COMCTL32_VERSION == 6 + CloseThemeData (GetWindowTheme (infoPtr->Self)); +#endif Free (infoPtr); return 0; } @@ -459,6 +471,7 @@ static BOOL IPADDRESS_GotoNextField (const IPADDRESS_INFO *infoPtr, int cur, int return FALSE; }
+#if __WINE_COMCTL32_VERSION == 6 static LRESULT IPADDRESS_ThemeChanged (const IPADDRESS_INFO *infoPtr) { HTHEME theme = GetWindowTheme (infoPtr->Self); @@ -467,6 +480,7 @@ static LRESULT IPADDRESS_ThemeChanged (const IPADDRESS_INFO *infoPtr) InvalidateRect (infoPtr->Self, NULL, TRUE); return 0; } +#endif
/* * period: move and select the text in the next field to the right if @@ -629,8 +643,10 @@ IPADDRESS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) COMCTL32_RefreshSysColors(); return 0;
+#if __WINE_COMCTL32_VERSION == 6 case WM_THEMECHANGED: return IPADDRESS_ThemeChanged (infoPtr); +#endif
case IPM_CLEARADDRESS: return IPADDRESS_ClearAddress (infoPtr);