mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 01:40:46 +08:00
add show and hide window function
This commit is contained in:
@@ -17,6 +17,8 @@ namespace asst {
|
||||
bool captured() const noexcept;
|
||||
bool resizeWindow(int Width, int Height);
|
||||
bool resizeWindow(); // by configer
|
||||
bool showWindow();
|
||||
bool hideWindow();
|
||||
bool click(const Point & p);
|
||||
bool clickRange(const Rect & rect);
|
||||
cv::Mat getImage(const Rect& rect);
|
||||
|
||||
@@ -22,6 +22,8 @@ Assistance::Assistance()
|
||||
|
||||
Assistance::~Assistance()
|
||||
{
|
||||
m_pWindow->showWindow();
|
||||
|
||||
m_thread_exit = true;
|
||||
m_thread_running = false;
|
||||
m_condvar.notify_one();
|
||||
|
||||
@@ -93,6 +93,24 @@ bool WinMacro::resizeWindow()
|
||||
return resizeWindow(m_width, m_height);
|
||||
}
|
||||
|
||||
bool WinMacro::showWindow()
|
||||
{
|
||||
if (m_handle_type != HandleType::Window) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return ::ShowWindow(m_handle, SW_SHOW);
|
||||
}
|
||||
|
||||
bool WinMacro::hideWindow()
|
||||
{
|
||||
if (m_handle_type != HandleType::Window) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return ::ShowWindow(m_handle, SW_HIDE);
|
||||
}
|
||||
|
||||
double WinMacro::getScreenScale()
|
||||
{
|
||||
static double scale = 0;
|
||||
|
||||
Reference in New Issue
Block a user