twain 新增 SANE_EVENT_ERROR
This commit is contained in:
parent
84d7dfc72d
commit
658ef6c120
|
@ -3175,6 +3175,21 @@ int scanner::handle_device_event(int ev_code, void* data, unsigned int* len)
|
|||
log_info(msg, 0);
|
||||
}
|
||||
}
|
||||
else if (ev_code == SANE_EVENT_ERROR)
|
||||
{
|
||||
if (callback::show_messagebox_ui && *len)
|
||||
{
|
||||
callback::show_messagebox_ui(app_wnd_, ev_code, (void*)data, 0);
|
||||
}
|
||||
else if (*len) //错误弹出
|
||||
{
|
||||
std::wstring msg(local_trans::a2u((char*)data, CP_UTF8));
|
||||
if (!IsWindow(app_wnd_))
|
||||
callback::bring_message_box_topmost(local_trans::lang_trans_between_hz936(CONST_STRING_ERROR).c_str());
|
||||
MessageBoxW(app_wnd_, msg.c_str(), local_trans::lang_trans_between_hz936(CONST_STRING_ERROR).c_str(), MB_OK);
|
||||
}
|
||||
on_ui_event(ev_code, (void*)ev_code);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue