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;