From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/comctl32/ipaddress.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/dlls/comctl32/ipaddress.c b/dlls/comctl32/ipaddress.c index 75918e00c70..4a6448a3ed2 100644 --- a/dlls/comctl32/ipaddress.c +++ b/dlls/comctl32/ipaddress.c @@ -130,6 +130,17 @@ static int IPADDRESS_GetPartIndex(const IPADDRESS_INFO *infoPtr, HWND hwnd) return -1; }
+static int IPADDRESS_GetThemeTextState (const IPADDRESS_INFO *infoPtr) +{ + if (!infoPtr->Enabled) + return ETS_DISABLED; + else if (GetWindowLongW(infoPtr->Self, GWL_STYLE) & ES_READONLY) + return ETS_READONLY; + else if (GetFocus() == infoPtr->Self) + return ETS_FOCUSED; + else + return ETS_NORMAL; +}
static LRESULT IPADDRESS_Draw (const IPADDRESS_INFO *infoPtr, HDC hdc) { @@ -145,15 +156,7 @@ static LRESULT IPADDRESS_Draw (const IPADDRESS_INFO *infoPtr, HDC hdc) theme = GetWindowTheme (infoPtr->Self);
if (theme) { - DWORD dwStyle = GetWindowLongW (infoPtr->Self, GWL_STYLE); - - if (!infoPtr->Enabled) - state = ETS_DISABLED; - else if (dwStyle & ES_READONLY) - state = ETS_READONLY; - else if (GetFocus() == infoPtr->Self) - state = ETS_FOCUSED; - + state = IPADDRESS_GetThemeTextState(infoPtr); GetThemeColor(theme, EP_EDITTEXT, state, TMT_FILLCOLOR, &bgCol); GetThemeColor(theme, EP_EDITTEXT, state, TMT_TEXTCOLOR, &fgCol);
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/comctl32/ipaddress.c | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-)
diff --git a/dlls/comctl32/ipaddress.c b/dlls/comctl32/ipaddress.c index 4a6448a3ed2..9e72f79e7e4 100644 --- a/dlls/comctl32/ipaddress.c +++ b/dlls/comctl32/ipaddress.c @@ -142,6 +142,31 @@ static int IPADDRESS_GetThemeTextState (const IPADDRESS_INFO *infoPtr) return ETS_NORMAL; }
+static void IPADDRESS_GetTextColors (const IPADDRESS_INFO *infoPtr, COLORREF *background_color, + COLORREF *foreground_color) +{ + HTHEME theme = GetWindowTheme(infoPtr->Self); + + if (theme) + { + int state = IPADDRESS_GetThemeTextState(infoPtr); + GetThemeColor(theme, EP_EDITTEXT, state, TMT_FILLCOLOR, background_color); + GetThemeColor(theme, EP_EDITTEXT, state, TMT_TEXTCOLOR, foreground_color); + return; + } + + if (infoPtr->Enabled) + { + *background_color = comctl32_color.clrWindow; + *foreground_color = comctl32_color.clrWindowText; + } + else + { + *background_color = comctl32_color.clr3dFace; + *foreground_color = comctl32_color.clrGrayText; + } +} + static LRESULT IPADDRESS_Draw (const IPADDRESS_INFO *infoPtr, HDC hdc) { RECT rect, rcPart; @@ -154,24 +179,14 @@ static LRESULT IPADDRESS_Draw (const IPADDRESS_INFO *infoPtr, HDC hdc) GetClientRect (infoPtr->Self, &rect);
theme = GetWindowTheme (infoPtr->Self); + IPADDRESS_GetTextColors(infoPtr, &bgCol, &fgCol);
if (theme) { state = IPADDRESS_GetThemeTextState(infoPtr); - GetThemeColor(theme, EP_EDITTEXT, state, TMT_FILLCOLOR, &bgCol); - GetThemeColor(theme, EP_EDITTEXT, state, TMT_TEXTCOLOR, &fgCol); - if (IsThemeBackgroundPartiallyTransparent (theme, EP_EDITTEXT, state)) DrawThemeParentBackground(infoPtr->Self, hdc, &rect); DrawThemeBackground (theme, hdc, EP_EDITTEXT, state, &rect, 0); } else { - if (infoPtr->Enabled) { - bgCol = comctl32_color.clrWindow; - fgCol = comctl32_color.clrWindowText; - } else { - bgCol = comctl32_color.clr3dFace; - fgCol = comctl32_color.clrGrayText; - } - FillRect (hdc, &rect, (HBRUSH)(DWORD_PTR)(bgCol+1)); DrawEdge (hdc, &rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST); }
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/comctl32/ipaddress.c | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-)
diff --git a/dlls/comctl32/ipaddress.c b/dlls/comctl32/ipaddress.c index 9e72f79e7e4..5ba1d0a9211 100644 --- a/dlls/comctl32/ipaddress.c +++ b/dlls/comctl32/ipaddress.c @@ -167,6 +167,25 @@ static void IPADDRESS_GetTextColors (const IPADDRESS_INFO *infoPtr, COLORREF *ba } }
+static void IPADDRESS_DrawBackground (const IPADDRESS_INFO *infoPtr, HDC hdc, RECT *rect) +{ + COLORREF background_color, foreground_color; + HTHEME theme = GetWindowTheme(infoPtr->Self); + + if (theme) + { + int state = IPADDRESS_GetThemeTextState(infoPtr); + if (IsThemeBackgroundPartiallyTransparent(theme, EP_EDITTEXT, state)) + DrawThemeParentBackground(infoPtr->Self, hdc, rect); + DrawThemeBackground(theme, hdc, EP_EDITTEXT, state, rect, 0); + return; + } + + IPADDRESS_GetTextColors(infoPtr, &background_color, &foreground_color); + FillRect(hdc, rect, (HBRUSH)(DWORD_PTR)(background_color + 1)); + DrawEdge(hdc, rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST); +} + static LRESULT IPADDRESS_Draw (const IPADDRESS_INFO *infoPtr, HDC hdc) { RECT rect, rcPart; @@ -179,18 +198,11 @@ static LRESULT IPADDRESS_Draw (const IPADDRESS_INFO *infoPtr, HDC hdc) GetClientRect (infoPtr->Self, &rect);
theme = GetWindowTheme (infoPtr->Self); - IPADDRESS_GetTextColors(infoPtr, &bgCol, &fgCol); - - if (theme) { + if (theme) state = IPADDRESS_GetThemeTextState(infoPtr); - if (IsThemeBackgroundPartiallyTransparent (theme, EP_EDITTEXT, state)) - DrawThemeParentBackground(infoPtr->Self, hdc, &rect); - DrawThemeBackground (theme, hdc, EP_EDITTEXT, state, &rect, 0); - } else { - FillRect (hdc, &rect, (HBRUSH)(DWORD_PTR)(bgCol+1)); - DrawEdge (hdc, &rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST); - } - + IPADDRESS_DrawBackground(infoPtr, hdc, &rect); + + IPADDRESS_GetTextColors(infoPtr, &bgCol, &fgCol); SetBkColor (hdc, bgCol); SetTextColor(hdc, fgCol);
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/comctl32/ipaddress.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/dlls/comctl32/ipaddress.c b/dlls/comctl32/ipaddress.c index 5ba1d0a9211..29a057ce085 100644 --- a/dlls/comctl32/ipaddress.c +++ b/dlls/comctl32/ipaddress.c @@ -186,20 +186,29 @@ static void IPADDRESS_DrawBackground (const IPADDRESS_INFO *infoPtr, HDC hdc, RE DrawEdge(hdc, rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST); }
+static void IPADDRESS_DrawDot (const IPADDRESS_INFO *infoPtr, HDC hdc, RECT *rect) +{ + HTHEME theme = GetWindowTheme(infoPtr->Self); + + if (theme) + { + int state = IPADDRESS_GetThemeTextState(infoPtr); + DrawThemeText(theme, hdc, EP_EDITTEXT, state, L".", 1, DT_SINGLELINE | DT_CENTER | DT_BOTTOM, 0, rect); + return; + } + + DrawTextW(hdc, L".", 1, rect, DT_SINGLELINE | DT_CENTER | DT_BOTTOM); +} + static LRESULT IPADDRESS_Draw (const IPADDRESS_INFO *infoPtr, HDC hdc) { RECT rect, rcPart; COLORREF bgCol, fgCol; - HTHEME theme; - int i, state = ETS_NORMAL; + int i;
TRACE("\n");
GetClientRect (infoPtr->Self, &rect); - - theme = GetWindowTheme (infoPtr->Self); - if (theme) - state = IPADDRESS_GetThemeTextState(infoPtr); IPADDRESS_DrawBackground(infoPtr, hdc, &rect);
IPADDRESS_GetTextColors(infoPtr, &bgCol, &fgCol); @@ -214,10 +223,7 @@ static LRESULT IPADDRESS_Draw (const IPADDRESS_INFO *infoPtr, HDC hdc) MapWindowPoints( 0, infoPtr->Self, (POINT *)&rcPart, 2 ); rect.right = rcPart.left;
- if (theme) - DrawThemeText(theme, hdc, EP_EDITTEXT, state, L".", 1, DT_SINGLELINE | DT_CENTER | DT_BOTTOM, 0, &rect); - else - DrawTextW(hdc, L".", 1, &rect, DT_SINGLELINE | DT_CENTER | DT_BOTTOM); + IPADDRESS_DrawDot(infoPtr, hdc, &rect); }
return 0;
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/comctl32/ipaddress.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/dlls/comctl32/ipaddress.c b/dlls/comctl32/ipaddress.c index 29a057ce085..6931574787c 100644 --- a/dlls/comctl32/ipaddress.c +++ b/dlls/comctl32/ipaddress.c @@ -130,6 +130,7 @@ static int IPADDRESS_GetPartIndex(const IPADDRESS_INFO *infoPtr, HWND hwnd) return -1; }
+#if __WINE_COMCTL32_VERSION == 6 static int IPADDRESS_GetThemeTextState (const IPADDRESS_INFO *infoPtr) { if (!infoPtr->Enabled) @@ -141,10 +142,12 @@ static int IPADDRESS_GetThemeTextState (const IPADDRESS_INFO *infoPtr) else return ETS_NORMAL; } +#endif
static void IPADDRESS_GetTextColors (const IPADDRESS_INFO *infoPtr, COLORREF *background_color, COLORREF *foreground_color) { +#if __WINE_COMCTL32_VERSION == 6 HTHEME theme = GetWindowTheme(infoPtr->Self);
if (theme) @@ -154,6 +157,7 @@ static void IPADDRESS_GetTextColors (const IPADDRESS_INFO *infoPtr, COLORREF *ba GetThemeColor(theme, EP_EDITTEXT, state, TMT_TEXTCOLOR, foreground_color); return; } +#endif
if (infoPtr->Enabled) { @@ -170,6 +174,7 @@ static void IPADDRESS_GetTextColors (const IPADDRESS_INFO *infoPtr, COLORREF *ba static void IPADDRESS_DrawBackground (const IPADDRESS_INFO *infoPtr, HDC hdc, RECT *rect) { COLORREF background_color, foreground_color; +#if __WINE_COMCTL32_VERSION == 6 HTHEME theme = GetWindowTheme(infoPtr->Self);
if (theme) @@ -180,6 +185,7 @@ static void IPADDRESS_DrawBackground (const IPADDRESS_INFO *infoPtr, HDC hdc, RE DrawThemeBackground(theme, hdc, EP_EDITTEXT, state, rect, 0); return; } +#endif
IPADDRESS_GetTextColors(infoPtr, &background_color, &foreground_color); FillRect(hdc, rect, (HBRUSH)(DWORD_PTR)(background_color + 1)); @@ -188,6 +194,7 @@ static void IPADDRESS_DrawBackground (const IPADDRESS_INFO *infoPtr, HDC hdc, RE
static void IPADDRESS_DrawDot (const IPADDRESS_INFO *infoPtr, HDC hdc, RECT *rect) { +#if __WINE_COMCTL32_VERSION == 6 HTHEME theme = GetWindowTheme(infoPtr->Self);
if (theme) @@ -196,6 +203,7 @@ static void IPADDRESS_DrawDot (const IPADDRESS_INFO *infoPtr, HDC hdc, RECT *rec DrawThemeText(theme, hdc, EP_EDITTEXT, state, L".", 1, DT_SINGLELINE | DT_CENTER | DT_BOTTOM, 0, rect); return; } +#endif
DrawTextW(hdc, L".", 1, rect, DT_SINGLELINE | DT_CENTER | DT_BOTTOM); } @@ -285,7 +293,7 @@ static LRESULT IPADDRESS_Create (HWND hwnd, const CREATESTRUCTA *lpCreate) }
IPADDRESS_UpdateText (infoPtr); - OpenThemeData (infoPtr->Self, WC_EDITW); + COMCTL32_OpenThemeForWindow (infoPtr->Self, WC_EDITW);
return 0; } @@ -293,7 +301,6 @@ static LRESULT IPADDRESS_Create (HWND hwnd, const CREATESTRUCTA *lpCreate)
static LRESULT IPADDRESS_Destroy (IPADDRESS_INFO *infoPtr) { - HTHEME theme; int i;
TRACE("\n"); @@ -306,8 +313,7 @@ static LRESULT IPADDRESS_Destroy (IPADDRESS_INFO *infoPtr) if (infoPtr->hFont) DeleteObject (infoPtr->hFont); SetWindowLongPtrW (infoPtr->Self, 0, 0); - theme = GetWindowTheme (infoPtr->Self); - CloseThemeData (theme); + COMCTL32_CloseThemeForWindow (infoPtr->Self); Free (infoPtr); return 0; } @@ -492,15 +498,6 @@ static BOOL IPADDRESS_GotoNextField (const IPADDRESS_INFO *infoPtr, int cur, int return FALSE; }
-static LRESULT IPADDRESS_ThemeChanged (const IPADDRESS_INFO *infoPtr) -{ - HTHEME theme = GetWindowTheme (infoPtr->Self); - CloseThemeData (theme); - theme = OpenThemeData (theme, WC_EDITW); - InvalidateRect (infoPtr->Self, NULL, TRUE); - return 0; -} - /* * period: move and select the text in the next field to the right if * the current field is not empty(l!=0), we are not in the @@ -663,7 +660,7 @@ IPADDRESS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return 0;
case WM_THEMECHANGED: - return IPADDRESS_ThemeChanged (infoPtr); + return COMCTL32_ThemeChanged (infoPtr->Self, WC_EDITW, TRUE, TRUE);
case IPM_CLEARADDRESS: return IPADDRESS_ClearAddress (infoPtr);
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/comctl32/listview.c | 37 +++++++++++-------------------------- 1 file changed, 11 insertions(+), 26 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index c0fc8d2103c..661a09bcc7f 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -418,8 +418,6 @@ typedef struct tagLISTVIEW_INFO TRACE("hwndSelf=%p, rcList=%s\n", iP->hwndSelf, wine_dbgstr_rect(&iP->rcList)); \ } while(0)
-static const WCHAR themeClass[] = L"ListView"; - enum key_state { SHIFT_KEY = 0x1, @@ -8557,6 +8555,7 @@ static BOOL LISTVIEW_SetColumnWidth(LISTVIEW_INFO *infoPtr, INT nColumn, INT cx) * Creates the checkbox imagelist. Helper for LISTVIEW_SetExtendedListViewStyle * */ +#if __WINE_COMCTL32_VERSION == 6 static HIMAGELIST LISTVIEW_CreateThemedCheckBoxImageList(const LISTVIEW_INFO *info) { HBITMAP bitmap, old_bitmap; @@ -8598,6 +8597,7 @@ static HIMAGELIST LISTVIEW_CreateThemedCheckBoxImageList(const LISTVIEW_INFO *in CloseThemeData(theme); return image_list; } +#endif /* __WINE_COMCTL32_VERSION == 6 */
static HIMAGELIST LISTVIEW_CreateCheckBoxIL(const LISTVIEW_INFO *infoPtr) { @@ -8607,9 +8607,11 @@ static HIMAGELIST LISTVIEW_CreateCheckBoxIL(const LISTVIEW_INFO *infoPtr) HBRUSH hbr_white, hbr_black; HIMAGELIST himl;
+#if __WINE_COMCTL32_VERSION == 6 himl = LISTVIEW_CreateThemedCheckBoxImageList(infoPtr); if (himl) return himl; +#endif
hbr_white = GetStockObject(WHITE_BRUSH); hbr_black = GetStockObject(BLACK_BRUSH); @@ -9466,26 +9468,6 @@ static BOOL LISTVIEW_SortItems(LISTVIEW_INFO *infoPtr, PFNLVCOMPARE pfnCompare, return TRUE; }
-/*** - * DESCRIPTION: - * Update theme handle after a theme change. - * - * PARAMETER(S): - * [I] infoPtr : valid pointer to the listview structure - * - * RETURN: - * SUCCESS : 0 - * FAILURE : something else - */ -static LRESULT LISTVIEW_ThemeChanged(const LISTVIEW_INFO *infoPtr) -{ - HTHEME theme = GetWindowTheme(infoPtr->hwndSelf); - CloseThemeData(theme); - OpenThemeData(infoPtr->hwndSelf, themeClass); - InvalidateRect(infoPtr->hwndSelf, NULL, TRUE); - return 0; -} - /*** * DESCRIPTION: * Updates an items or rearranges the listview control. @@ -9709,7 +9691,7 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs) if (infoPtr->dwStyle & LVS_OWNERDRAWFIXED) notify_measureitem(infoPtr); }
- OpenThemeData(hwnd, themeClass); + COMCTL32_OpenThemeForWindow(hwnd, L"ListView");
/* initialize the icon sizes */ set_icon_size(&infoPtr->iconSize, infoPtr->himlNormal, infoPtr->uView != LV_VIEW_ICON); @@ -9730,8 +9712,7 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs) */ static LRESULT LISTVIEW_Destroy(LISTVIEW_INFO *infoPtr) { - HTHEME theme = GetWindowTheme(infoPtr->hwndSelf); - CloseThemeData(theme); + COMCTL32_CloseThemeForWindow(infoPtr->hwndSelf);
/* delete all items */ LISTVIEW_DeleteAllItems(infoPtr, TRUE); @@ -10745,6 +10726,7 @@ static LRESULT LISTVIEW_Notify(LISTVIEW_INFO *infoPtr, NMHDR *lpnmhdr) */ static LRESULT LISTVIEW_NCPaint(const LISTVIEW_INFO *infoPtr, HRGN region) { +#if __WINE_COMCTL32_VERSION == 6 LONG exstyle = GetWindowLongW (infoPtr->hwndSelf, GWL_EXSTYLE); HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); RECT r, window_rect; @@ -10782,6 +10764,9 @@ static LRESULT LISTVIEW_NCPaint(const LISTVIEW_INFO *infoPtr, HRGN region) DeleteObject(cliprgn);
return 0; +#else /* __WINE_COMCTL32_VERSION == 6 */ + return DefWindowProcW(infoPtr->hwndSelf, WM_NCPAINT, (WPARAM)region, 0); +#endif }
/*** @@ -11935,7 +11920,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* case WM_TIMER: */ case WM_THEMECHANGED: - return LISTVIEW_ThemeChanged(infoPtr); + return COMCTL32_ThemeChanged(infoPtr->hwndSelf, L"ListView", TRUE, TRUE);
case WM_VSCROLL: return LISTVIEW_VScroll(infoPtr, (INT)LOWORD(wParam), 0);
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/comctl32/monthcal.c | 43 +++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 25 deletions(-)
diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c index ccbb57107d3..52a18eb0593 100644 --- a/dlls/comctl32/monthcal.c +++ b/dlls/comctl32/monthcal.c @@ -139,8 +139,6 @@ typedef struct SIZE dim; /* [cx,cy] - dimensions of calendars matrix, row/column count */ } MONTHCAL_INFO, *LPMONTHCAL_INFO;
-static const WCHAR themeClass[] = L"Scrollbar"; - /* empty SYSTEMTIME const */ static const SYSTEMTIME st_null; /* valid date limits */ @@ -820,10 +818,14 @@ static void MONTHCAL_DrawDay(const MONTHCAL_INFO *infoPtr, HDC hdc, const SYSTEM
static void MONTHCAL_PaintButton(MONTHCAL_INFO *infoPtr, HDC hdc, enum nav_direction button) { - HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); RECT *r = button == DIRECTION_FORWARD ? &infoPtr->titlebtnnext : &infoPtr->titlebtnprev; BOOL pressed = button == DIRECTION_FORWARD ? infoPtr->status & MC_NEXTPRESSED : infoPtr->status & MC_PREVPRESSED; + int style; + +#if __WINE_COMCTL32_VERSION == 6 + HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); + if (theme) { static const int states[] = { @@ -840,19 +842,20 @@ static void MONTHCAL_PaintButton(MONTHCAL_INFO *infoPtr, HDC hdc, enum nav_direc if (infoPtr->dwStyle & WS_DISABLED) stateNum += 2; } DrawThemeBackground (theme, hdc, SBP_ARROWBTN, states[stateNum], r, NULL); + return; } +#endif + + style = button == DIRECTION_FORWARD ? DFCS_SCROLLRIGHT : DFCS_SCROLLLEFT; + if (pressed) + style |= DFCS_PUSHED; else { - int style = button == DIRECTION_FORWARD ? DFCS_SCROLLRIGHT : DFCS_SCROLLLEFT; - if (pressed) - style |= DFCS_PUSHED; - else - { - if (infoPtr->dwStyle & WS_DISABLED) style |= DFCS_INACTIVE; - } - - DrawFrameControl(hdc, r, DFC_SCROLL, style); + if (infoPtr->dwStyle & WS_DISABLED) + style |= DFCS_INACTIVE; } + + DrawFrameControl(hdc, r, DFC_SCROLL, style); }
/* paint a title with buttons and month/year string */ @@ -2688,16 +2691,6 @@ static LRESULT MONTHCAL_SetFont(MONTHCAL_INFO *infoPtr, HFONT hFont, BOOL redraw return (LRESULT)hOldFont; }
-/* update theme after a WM_THEMECHANGED message */ -static LRESULT theme_changed (const MONTHCAL_INFO* infoPtr) -{ - HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); - CloseThemeData (theme); - OpenThemeData (infoPtr->hwndSelf, themeClass); - InvalidateRect (infoPtr->hwndSelf, NULL, TRUE); - return 0; -} - static INT MONTHCAL_StyleChanged(MONTHCAL_INFO *infoPtr, WPARAM wStyleType, const STYLESTRUCT *lpss) { @@ -2797,7 +2790,7 @@ MONTHCAL_Create(HWND hwnd, LPCREATESTRUCTW lpcs) /* today auto update timer, to be freed only on control destruction */ SetTimer(infoPtr->hwndSelf, MC_TODAYUPDATETIMER, MC_TODAYUPDATEDELAY, 0);
- OpenThemeData (infoPtr->hwndSelf, themeClass); + COMCTL32_OpenThemeForWindow(infoPtr->hwndSelf, L"Scrollbar");
return 0;
@@ -2817,7 +2810,7 @@ MONTHCAL_Destroy(MONTHCAL_INFO *infoPtr) Free(infoPtr->calendars); SetWindowLongPtrW(infoPtr->hwndSelf, 0, 0);
- CloseThemeData (GetWindowTheme (infoPtr->hwndSelf)); + COMCTL32_CloseThemeForWindow(infoPtr->hwndSelf);
for (i = 0; i < BrushLast; i++) DeleteObject(infoPtr->brushes[i]); for (i = 0; i < PenLast; i++) DeleteObject(infoPtr->pens[i]); @@ -2991,7 +2984,7 @@ MONTHCAL_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return MONTHCAL_Timer(infoPtr, wParam);
case WM_THEMECHANGED: - return theme_changed (infoPtr); + return COMCTL32_ThemeChanged(infoPtr->hwndSelf, L"Scrollbar", TRUE, TRUE);
case WM_DESTROY: return MONTHCAL_Destroy(infoPtr);
Nikolay Sivov (@nsivov) commented about dlls/comctl32/ipaddress.c:
+static void IPADDRESS_DrawBackground (const IPADDRESS_INFO *infoPtr, HDC hdc, RECT *rect) +{
- COLORREF background_color, foreground_color;
- HTHEME theme = GetWindowTheme(infoPtr->Self);
- if (theme)
- {
int state = IPADDRESS_GetThemeTextState(infoPtr);if (IsThemeBackgroundPartiallyTransparent(theme, EP_EDITTEXT, state))DrawThemeParentBackground(infoPtr->Self, hdc, rect);DrawThemeBackground(theme, hdc, EP_EDITTEXT, state, rect, 0);return;- }
- IPADDRESS_GetTextColors(infoPtr, &background_color, &foreground_color);
- FillRect(hdc, rect, (HBRUSH)(DWORD_PTR)(background_color + 1));
I think just (HBRUSH) should do it, no?
This merge request was approved by Nikolay Sivov.
On Thu Oct 30 09:56:49 2025 +0000, Nikolay Sivov wrote:
I think just (HBRUSH) should do it, no?
yes. I wanted to avoid any potential behavior changes so I kept it the way it was in the original code.
While trying this I can already existing issue with themed IP Address control - with our default theme dots are almost invisible on white background. Since it's rendered as a regular text, it's probably something do with state used for those dots, but I didn't investigate.
On Thu Oct 30 10:08:16 2025 +0000, Nikolay Sivov wrote:
While trying this I can already existing issue with themed IP Address control - with our default theme dots are almost invisible on white background. Since it's rendered as a regular text, it's probably something do with state used for those dots, but I didn't investigate.
Yes, we should modify the light theme source to make it more obvious. I will put it on my list.