From 824837ec2c223d651d4ebb724b418fc4506d6d0b Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Sun, 12 Aug 2018 22:40:00 +0300 Subject: [PATCH] comctl32: Fix background and text color for DrawStatusText(). Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/comctl32/commctrl.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c index 1117ec43e91..45b93bdc8b5 100644 --- a/dlls/comctl32/commctrl.c +++ b/dlls/comctl32/commctrl.c @@ -487,20 +487,24 @@ void WINAPI DrawStatusTextW (HDC hdc, LPCRECT lprc, LPCWSTR text, UINT style) { RECT r = *lprc; UINT border = BDR_SUNKENOUTER; + COLORREF oldbkcolor; if (style & SBT_POPOUT) border = BDR_RAISEDOUTER; else if (style & SBT_NOBORDERS) border = 0; - DrawEdge (hdc, &r, border, BF_RECT|BF_ADJUST); + oldbkcolor = SetBkColor (hdc, comctl32_color.clrBtnFace); + DrawEdge (hdc, &r, border, BF_MIDDLE|BF_RECT|BF_ADJUST); /* now draw text */ if (text) { int oldbkmode = SetBkMode (hdc, TRANSPARENT); + COLORREF oldtextcolor; UINT align = DT_LEFT; int strCnt = 0; + oldtextcolor = SetTextColor (hdc, comctl32_color.clrBtnText); if (style & SBT_RTLREADING) FIXME("Unsupported RTL style!\n"); r.left += 3; @@ -520,8 +524,11 @@ void WINAPI DrawStatusTextW (HDC hdc, LPCRECT lprc, LPCWSTR text, UINT style) } while(*text++); if (strCnt) DrawTextW (hdc, text - strCnt, -1, &r, align|DT_VCENTER|DT_SINGLELINE|DT_NOPREFIX); - SetBkMode(hdc, oldbkmode); + SetBkMode (hdc, oldbkmode); + SetTextColor (hdc, oldtextcolor); } + + SetBkColor (hdc, oldbkcolor); }