From 3289a7b1a88fbcf218e5c240f2934ee5957bd201 Mon Sep 17 00:00:00 2001 From: gb <741021719@qq.com> Date: Thu, 10 Nov 2022 11:10:02 +0800 Subject: [PATCH] =?UTF-8?q?=E9=81=BF=E5=85=8DCUSTOM=5FDRAW=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E8=A7=A6=E5=8F=91=E8=AE=BE=E7=BD=AE=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sane/DlgPage.cpp | 12 ++++++++---- sane/scanner.cpp | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/sane/DlgPage.cpp b/sane/DlgPage.cpp index 6294c4a..40b461d 100644 --- a/sane/DlgPage.cpp +++ b/sane/DlgPage.cpp @@ -852,10 +852,14 @@ BOOL dlg_page::on_notify(int ctrl_id, LPNMHDR pnmh) pnmh->code == NM_TOOLTIPSCREATED; GetClassNameW((HWND)pnmh->hwndFrom, cls, _countof(cls) - 1); if (IS_TRACKBAR(cls)) - { - if (pnmh->code != NM_RELEASEDCAPTURE && - pnmh->code != NM_CUSTOMDRAW) - return FALSE; + { + if (pnmh->code != NM_RELEASEDCAPTURE) + { + if (pnmh->code == NM_CUSTOMDRAW && (GetAsyncKeyState(VK_LBUTTON) & 0x8000) && GetFocus() == pnmh->hwndFrom) // drag track ... + ; + else + return FALSE; + } } else if (IS_UPDOWN_ARROW(cls)) { diff --git a/sane/scanner.cpp b/sane/scanner.cpp index a93d82e..ae5f2e7 100644 --- a/sane/scanner.cpp +++ b/sane/scanner.cpp @@ -784,7 +784,7 @@ int scanner::init_options_id(void) while ((desc = hg_sane_middleware::instance()->get_option_descriptor(handle_, op_id))) { - void* val = hg_sane_middleware::instance()->get_def_value(handle_, op_id); + void* val = hg_sane_middleware::instance()->get_def_value(handle_, op_id, NULL, true); if (val) { size_t len = 0;