This commit is contained in:
13038267101 2023-01-12 16:48:57 +08:00
commit 6ba0906e8a
3 changed files with 10 additions and 10 deletions

View File

@ -56,9 +56,14 @@ BOOL dlg_indicator::handle_message(UINT msg, WPARAM wp, LPARAM lp)
{ {
DRAWITEMSTRUCT* ds = (DRAWITEMSTRUCT*)lp; DRAWITEMSTRUCT* ds = (DRAWITEMSTRUCT*)lp;
wchar_t text[128] = { 0 }; wchar_t text[128] = { 0 };
SetTextColor(ds->hDC, err_ ? RGB(255, 0, 0) : RGB(0, 0, 0)); HBRUSH brsh = CreateSolidBrush(GetBkColor(ds->hDC));
SetBkMode(ds->hDC, TRANSPARENT);
FillRect(ds->hDC, &ds->rcItem, brsh);
DeleteObject(brsh);
GetWindowTextW(ds->hwndItem, text, _countof(text) - 1); 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)); TextOutW(ds->hDC, 0, 0, text, lstrlenW(text));
} }
ret = FALSE; ret = FALSE;

View File

@ -1109,9 +1109,9 @@ bool scanner::get_option_value_with_parent(int sn, set_opt_value setv, void* par
return handled; 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_) 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); *err = hg_sane_middleware::instance()->set_option(handle_, scan_mode_id_, SANE_ACTION_SET_VALUE, val, &after);
} }
delete[] val; delete[] val;
// handled = false;
}
else
{
handled = false;
} }
return handled; return handled;

View File

@ -82,7 +82,7 @@ class scanner : public ISaneInvoker, virtual public refer
void extension_erase_color(int id); 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 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); int set_option_value(int sn, SANE_Value_Type type, int size, void* data);
typedef struct _ex_api typedef struct _ex_api