no_bitdepth_已经处理了军队扫描2.0.exe问题;修复获取配置整数空值的BUG

This commit is contained in:
gb 2023-08-26 09:16:00 +08:00
parent 8862396868
commit 6e5d7a683a
1 changed files with 13 additions and 8 deletions

View File

@ -1988,12 +1988,6 @@ void huagao_ds::init_support_caps(void)
auto mech = data.currentItem<CapType::IBitDepth>();
if (Msg::Set == msg)
{
#ifdef ARMY_SCANNER
if (mech >= 0 && mech <= 2)
val = mech;
else
val = COLOR_RGB;
#else
if (mech == 1)
val = COLOR_BW;
else if (mech == 8)
@ -2002,7 +1996,6 @@ void huagao_ds::init_support_caps(void)
val = COLOR_RGB;
else
val = COLOR_RGB; // mech;
#endif
}
{
wchar_t info[128] = { 0 };
@ -3711,7 +3704,19 @@ DWORD huagao_ds::get_config_number(const wchar_t* sec, const wchar_t* key, DWORD
if (cfg_f.empty())
return empty;
else
return GetPrivateProfileIntW(sec, key, def, get_config_file().c_str());
{
DWORD val = GetPrivateProfileIntW(sec, key, def, cfg_f.c_str());
if (val == def)
{
val = GetPrivateProfileIntW(sec, key, def + 2, cfg_f.c_str());
if (val == def + 2)
val = empty;
else
val = def;
}
return val;
}
}
int huagao_ds::handle_scanner_event(int ev, bool from_event_proc)
{