twain 新增 SANE_EVENT_ERROR

This commit is contained in:
13038267101 2023-05-05 09:47:34 +08:00
parent 84d7dfc72d
commit 658ef6c120
1 changed files with 17 additions and 2 deletions

View File

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