From 0a4df946cb8788eebbbecee10687ea3764ef5879 Mon Sep 17 00:00:00 2001 From: gb <741021719@qq.com> Date: Tue, 10 Jan 2023 14:22:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BF=9B=E5=BA=A6=E6=8C=87?= =?UTF-8?q?=E7=A4=BA=E5=99=A8=E6=89=AB=E6=8F=8F=E5=AE=8C=E6=88=90=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E5=A4=9A=E4=B8=AA=E6=B6=88=E6=81=AF=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84=E7=95=8C=E9=9D=A2=E6=96=87=E5=AD=97?= =?UTF-8?q?=E6=A8=A1=E7=B3=8A=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sane/DlgIndicator.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sane/DlgIndicator.cpp b/sane/DlgIndicator.cpp index 12aced5..7c9b7e7 100644 --- a/sane/DlgIndicator.cpp +++ b/sane/DlgIndicator.cpp @@ -56,9 +56,14 @@ BOOL dlg_indicator::handle_message(UINT msg, WPARAM wp, LPARAM lp) { DRAWITEMSTRUCT* ds = (DRAWITEMSTRUCT*)lp; wchar_t text[128] = { 0 }; - SetTextColor(ds->hDC, err_ ? RGB(255, 0, 0) : RGB(0, 0, 0)); - SetBkMode(ds->hDC, TRANSPARENT); + HBRUSH brsh = CreateSolidBrush(GetBkColor(ds->hDC)); + + FillRect(ds->hDC, &ds->rcItem, brsh); + DeleteObject(brsh); + GetWindowTextW(ds->hwndItem, text, _countof(text) - 1); + SetBkMode(ds->hDC, TRANSPARENT); + SetTextColor(ds->hDC, err_ ? RGB(255, 0, 0) : RGB(0, 0, 0)); TextOutW(ds->hDC, 0, 0, text, lstrlenW(text)); } ret = FALSE;