修复进度指示器扫描完成后,多个消息触发导致的界面文字模糊问题

This commit is contained in:
gb 2023-01-10 14:22:42 +08:00
parent 277219b1be
commit 0a4df946cb
1 changed files with 7 additions and 2 deletions

View File

@ -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;