From 93d46358054fe28f16d16e6c53daab686f57808c Mon Sep 17 00:00:00 2001 From: hui-shao Date: Fri, 17 Jan 2025 16:23:38 +0800 Subject: [PATCH] [fix] use SW_RESTORE. Others: v0.1.0.1 --- CMakeLists.txt | 2 +- src/TrayIconManager.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 53be877..0a0f51b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.10) -project(AutoTrayIt VERSION 0.1.0) # 项目名称和版本号 +project(AutoTrayIt VERSION 0.1.0.1) # 项目名称和版本号 set(CMAKE_CXX_STANDARD 20) diff --git a/src/TrayIconManager.cpp b/src/TrayIconManager.cpp index ffa7626..49cf420 100644 --- a/src/TrayIconManager.cpp +++ b/src/TrayIconManager.cpp @@ -74,7 +74,7 @@ void TrayIconManager::HandleTrayIconMessage(WPARAM wParam, LPARAM lParam) if (nid.uID == wParam) // 根据 nid 找到对应的被隐藏窗口 { manuallyShown = true; // 标记为手动显示,防止被意外隐藏 - ShowWindow(hwnd, SW_SHOW); + ShowWindow(hwnd, SW_RESTORE); Shell_NotifyIconW(NIM_DELETE, &nid); break; } @@ -82,7 +82,7 @@ void TrayIconManager::HandleTrayIconMessage(WPARAM wParam, LPARAM lParam) } else // Ctrl未按下,双击托盘图标,切换窗口可见性 { - if (wParam == nidMain.uID) ShowWindow(nidMain.hWnd, IsWindowVisible(nidMain.hWnd) ? SW_HIDE : SW_SHOW); + if (wParam == nidMain.uID) ShowWindow(nidMain.hWnd, IsWindowVisible(nidMain.hWnd) ? SW_HIDE : SW_RESTORE); else WindowManager::ToggleWindowVisibilityByTrayIconId(static_cast(wParam)); // 双击被隐藏程序的托盘图标时,切换窗口显示状态 } }