解决win7调用twain崩溃的问题

This commit is contained in:
yangjiaxuan 2024-05-30 09:42:46 +08:00
parent 1e329882af
commit 43c4a0b731
1 changed files with 13 additions and 0 deletions

View File

@ -79,6 +79,19 @@ int Manager::showSettingUi(SANE_Handle device, HWND parent, LPSANEAPI api, const
m_device = device;
scanner_cfg_ = cfg;
m_settingUiParent = (HGWindow)parent;
#ifdef HG_CMP_MSC
OSVERSIONINFOW info;
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW);
if (GetVersionExW(&info))
{
if (info.dwMajorVersion == 6 && info.dwMinorVersion == 1)
{
m_settingUiParent = NULL;
}
}
#endif
memcpy(&m_api, api, sizeof(m_api));
m_devName = devName;
m_with_scan = with_scan;