Skip to content

Commit

Permalink
[fix] use SW_RESTORE.
Browse files Browse the repository at this point in the history
Others: v0.1.0.1
  • Loading branch information
hui-shao committed Jan 17, 2025
1 parent cc6d2b2 commit 93d4635
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
4 changes: 2 additions & 2 deletions src/TrayIconManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ 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;
}
}
}
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<UINT>(wParam)); // 双击被隐藏程序的托盘图标时,切换窗口显示状态
}
}
Expand Down

0 comments on commit 93d4635

Please # to comment.