From 0e805aa35898d730ec412af21a8c0e88b2a59913 Mon Sep 17 00:00:00 2001
From: Gerard Patel <g.patel@wanadoo.fr>
Date: Sun, 16 Jul 2000 14:39:21 +0000
Subject: [PATCH] Background of SS_SIMPLE static control is not filled (unless
 it has SS_NOPREFIX too).

---
 controls/static.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/controls/static.c b/controls/static.c
index f054522d39b..8b7c5d10e11 100644
--- a/controls/static.c
+++ b/controls/static.c
@@ -409,11 +409,14 @@ static void STATIC_PaintTextfn( WND *wndPtr, HDC hdc )
 	wFormat |= DT_NOPREFIX;
 
     if (infoPtr->hFont) SelectObject( hdc, infoPtr->hFont );
-    hBrush = SendMessageA( GetParent(wndPtr->hwndSelf), WM_CTLCOLORSTATIC,
-                             hdc, wndPtr->hwndSelf );
-    if (!hBrush) hBrush = GetStockObject(WHITE_BRUSH);
-    FillRect( hdc, &rc, hBrush );    
 
+    if ((style & SS_NOPREFIX) || ((style & SS_TYPEMASK) != SS_SIMPLE))
+    {
+        hBrush = SendMessageA( GetParent(wndPtr->hwndSelf), WM_CTLCOLORSTATIC,
+                             hdc, wndPtr->hwndSelf );
+        if (!hBrush) hBrush = GetStockObject(WHITE_BRUSH);
+        FillRect( hdc, &rc, hBrush );    
+    }
     if (!IsWindowEnabled(wndPtr->hwndSelf))
    	SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT));
 
-- 
GitLab