From 0eaf2a42f4d4ef2a408a8a360bcfcd8036f3711c Mon Sep 17 00:00:00 2001 From: gb <741021719@qq.com> Date: Mon, 11 Dec 2023 15:17:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E7=95=8C=E9=9D=A2=E5=8F=8A?= =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E6=8C=87=E7=A4=BA=E5=99=A8=E7=88=B6=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=E5=A6=82=E6=9E=9C=E4=B8=8D=E5=8F=AF=E8=A7=81=EF=BC=8C?= =?UTF-8?q?=E5=88=99=E6=94=B9=E4=B8=BANULL=E4=B8=BA=E7=88=B6=E7=AA=97?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sane/scanner.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sane/scanner.cpp b/sane/scanner.cpp index 968a19a..977d893 100644 --- a/sane/scanner.cpp +++ b/sane/scanner.cpp @@ -3494,6 +3494,9 @@ COM_API_IMPLEMENT(scanner, bool, ui_show_setting(HWND parent, bool with_scan, bo events_.clear(); ui_notify = std::function(); + if (!IsWindowVisible(parent)) + parent = NULL; + if (callback::show_setting_ui) { if (with_scan) @@ -3589,6 +3592,9 @@ COM_API_IMPLEMENT(scanner, bool, ui_show_progress(HWND parent, bool bIndicator)) is_bIndicator = bIndicator; if (is_bIndicator) ui_notify = std::function(); + if (!IsWindowVisible(parent)) + parent = NULL; + auto ui_process = [this](ui_result res) { int uev = SANE_EVENT_SCAN_FINISHED;