From 07763aade5466b9431e02d8863f8e7f81418976e Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Fri, 24 Jun 2005 11:33:23 +0000 Subject: [PATCH] Paint the background with the correct color if WS_BORDER. --- dlls/user/edit.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/dlls/user/edit.c b/dlls/user/edit.c index 7f0eb189f68..707c4f36de3 100644 --- a/dlls/user/edit.c +++ b/dlls/user/edit.c @@ -4677,6 +4677,7 @@ static void EDIT_WM_Paint(EDITSTATE *es, HDC hdc) RECT rcLine; RECT rcRgn; HBRUSH brush; + HBRUSH old_brush; BOOL rev = es->bEnableState && ((es->flags & EF_FOCUSED) || (es->style & ES_NOHIDESEL)); @@ -4684,21 +4685,25 @@ static void EDIT_WM_Paint(EDITSTATE *es, HDC hdc) GetClientRect(es->hwndSelf, &rcClient); - /* paint the background */ + /* get the background brush */ if (!(brush = EDIT_NotifyCtlColor(es, dc))) brush = (HBRUSH)GetStockObject(WHITE_BRUSH); - IntersectClipRect(dc, rcClient.left, rcClient.top, rcClient.right, rcClient.bottom); - GetClipBox(dc, &rc); - FillRect(dc, &rc, brush); - /* draw the border */ + /* paint the border and the background */ + IntersectClipRect(dc, rcClient.left, rcClient.top, rcClient.right, rcClient.bottom); if(es->style & WS_BORDER) { rc = rcClient; if(es->style & ES_MULTILINE) { if(es->style & WS_HSCROLL) rc.bottom++; if(es->style & WS_VSCROLL) rc.right++; } + old_brush = SelectObject(dc, brush); Rectangle(dc, rc.left, rc.top, rc.right, rc.bottom); + SelectObject(dc, old_brush); + } + else { + GetClipBox(dc, &rc); + FillRect(dc, &rc, brush); } IntersectClipRect(dc, es->format_rect.left, es->format_rect.top,