diff --git a/modules/twain_user/HGTwainImpl.cpp b/modules/twain_user/HGTwainImpl.cpp index 51a2a31a..68f472d9 100644 --- a/modules/twain_user/HGTwainImpl.cpp +++ b/modules/twain_user/HGTwainImpl.cpp @@ -610,11 +610,6 @@ HGResult HGTwainDSImpl::Enable(HGBool showUI, HWND parent, HGDSCloseReqFunc even return HGTWAIN_ERR_FAIL; } - if (!showUI) - { - HGBase_SetEvent(m_event); - } - m_showUI = showUI; m_parent = parent; m_eventFunc = eventFunc; @@ -993,6 +988,7 @@ void HGAPI HGTwainDSImpl::ThreadFunc(HGThread thread, HGPointer param) } } - p->Disable(); + if (!p->m_showUI) + p->Disable(); } }