diff --git a/sane/scanner.cpp b/sane/scanner.cpp index c987dd7..a8081e4 100644 --- a/sane/scanner.cpp +++ b/sane/scanner.cpp @@ -1421,14 +1421,15 @@ int scanner::thread_start(void) { // display error message on progress UI, may be closed immediately by APP, so we hide progress UI and call message_box ... // - //if (callback::show_progress_ui && is_bIndicator) - //{ - // int ev = SANE_EVENT_WORKING; - // - //// on_ui_event(ev, (void*)ev); - // ui_notify(SANE_EVENT_SCAN_FINISHED, (void *)hg_scanner_err_description(ret), ret); - //} - //else +#ifdef START_SCAN_IN_THREAD + if (callback::show_progress_ui && is_bIndicator) + { + int ev = SANE_EVENT_WORKING; + + ui_notify(SANE_EVENT_SCAN_FINISHED, (void *)hg_scanner_err_description(ret), ret); + } + else +#endif { if (callback::close_ui) callback::close_ui(UI_INDICATOR); @@ -1447,8 +1448,8 @@ int scanner::thread_start(void) callback::bring_message_box_topmost(local_trans::lang_trans_between_hz936(CONST_STRING_START_FAILED).c_str()); MessageBoxW(app_wnd_, msg.c_str(), local_trans::lang_trans_between_hz936(CONST_STRING_START_FAILED).c_str(), MB_OK | MB_ICONERROR); } + is_scanning_ = false; } - is_scanning_ = false; } prev_start_result_ = ret;