fix resizeWindow

This commit is contained in:
MistEO
2021-07-11 18:49:45 +08:00
parent c4b10c1859
commit fbf1691f05
3 changed files with 6 additions and 5 deletions

View File

@@ -50,7 +50,11 @@ bool Assistance::setSimulatorType(SimulatorType type)
m_pCtrl = std::make_shared<WinMacro>(static_cast<HandleType>(int_type | static_cast<int>(HandleType::Control)));
m_pWindow = std::make_shared<WinMacro>(static_cast<HandleType>(int_type | static_cast<int>(HandleType::Window)));
m_pView = std::make_shared<WinMacro>(static_cast<HandleType>(int_type | static_cast<int>(HandleType::View)));
return m_pCtrl->findHandle() && m_pWindow->findHandle() && m_pView->findHandle();
bool ret = m_pCtrl->findHandle() && m_pWindow->findHandle() && m_pView->findHandle();
if (ret) {
m_pWindow->resizeWindow(1200, 720);
}
return ret;
}
void Assistance::start()
@@ -127,8 +131,6 @@ void Assistance::identify_function(Assistance* pThis)
void Assistance::control_function(Assistance* pThis)
{
pThis->m_pWindow->resizeWindow(1200, 720);
while (!pThis->m_control_exit) {
std::unique_lock<std::mutex> lock(pThis->m_tasks_mutex);
if (pThis->m_control_running && !pThis->m_tasks.empty()) {

View File

@@ -174,7 +174,6 @@
<ClInclude Include="Assistance.h" />
<ClInclude Include="Configer.h" />
<ClInclude Include="Identify.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="WinMacro.h" />
</ItemGroup>
<ItemGroup>

View File

@@ -63,7 +63,7 @@ bool WinMacro::resizeWindow(int width, int height)
return false;
}
return ::MoveWindow(m_handle, 100, 100, width, height, true);
return ::MoveWindow(m_handle, 0, 0, width, height, true);
}
double WinMacro::getScreenScale()