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; diff --git a/sane/scanner.cpp b/sane/scanner.cpp index 7cb40ee..c4d4023 100644 --- a/sane/scanner.cpp +++ b/sane/scanner.cpp @@ -1109,9 +1109,9 @@ bool scanner::get_option_value_with_parent(int sn, set_opt_value setv, void* par return handled; } -bool scanner::set_option_value_with_parent(int sn, void* data, int* err) // return true if handled +bool scanner::set_option_value_with_parent(int sn, void* data, int* err) // return true if handled sn { - bool handled = true; + bool handled = false; if (sn == scan_count_id_) { @@ -1135,11 +1135,6 @@ bool scanner::set_option_value_with_parent(int sn, void* data, int* err) // retu *err = hg_sane_middleware::instance()->set_option(handle_, scan_mode_id_, SANE_ACTION_SET_VALUE, val, &after); } delete[] val; - // handled = false; - } - else - { - handled = false; } return handled; diff --git a/sane/scanner.h b/sane/scanner.h index 996933c..63044c2 100644 --- a/sane/scanner.h +++ b/sane/scanner.h @@ -82,7 +82,7 @@ class scanner : public ISaneInvoker, virtual public refer void extension_erase_color(int id); bool get_option_value_with_parent(int sn, set_opt_value setv, void* param); // return true if handled - bool set_option_value_with_parent(int sn, void* data, int* err); // return true if handled + bool set_option_value_with_parent(int sn, void* data, int* err); // return true if handled sn int set_option_value(int sn, SANE_Value_Type type, int size, void* data); typedef struct _ex_api