Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ Boss-Key
- 无法隐藏部分游戏窗口,可能由于游戏窗口加密导致

## 更新日志
**V2.0.4 (更新于2025/4/9)**
- 修复无法正确禁音应用的问题
- 优化选项提示
- 优化禁音匹配规则

**V2.0.3 (更新于2025/4/5)**
- 新增文件路径匹配选项
- 新增窗口恢复工具
Expand Down
11 changes: 9 additions & 2 deletions main/GUI/setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,17 @@ def init_UI(self):
settings_checkbox_sizer.Add(hide_icon_after_hide_sizer, proportion=1,flag=wx.EXPAND| wx.ALL, border=10)

path_match_sizer=wx.BoxSizer(wx.HORIZONTAL)
path_icon_sizer = wx.BoxSizer(wx.HORIZONTAL)
path_match_tooltip = "启用此选项可以一键隐藏绑定程序的所有窗口\r\n关闭此选项后,将会智能精确隐藏指定窗口"
path_match_label = wx.StaticText(panel, label="文件路径匹配")
path_match_label.SetToolTip(wx.ToolTip("启用文件路径匹配可以匹配同一程序的不同窗口"))
path_match_label.SetToolTip(path_match_tooltip)
path_match_checkbox = wx.CheckBox(panel, self.ID_PATH_MATCH_CHECKBOX, "")
path_match_sizer.Add(path_match_label,proportion=1, flag=wx.EXPAND| wx.ALL)
path_match_tooltip_icon = wx.StaticBitmap(panel, bitmap=wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, wx.ART_OTHER, self.FromDIP((14, 14))))
path_match_tooltip_icon.SetToolTip(path_match_tooltip)
path_icon_sizer.Add(path_match_label,flag=wx.EXPAND| wx.ALL)
path_icon_sizer.AddSpacer(5)
path_icon_sizer.Add(path_match_tooltip_icon,flag=wx.EXPAND| wx.ALL)
path_match_sizer.Add(path_icon_sizer, proportion=1,flag=wx.EXPAND| wx.ALL)
path_match_sizer.Add(path_match_checkbox,proportion=1, flag=wx.EXPAND| wx.ALL)
settings_checkbox_sizer.Add(path_match_sizer, proportion=1,flag=wx.EXPAND| wx.ALL, border=10)

Expand Down
6 changes: 3 additions & 3 deletions main/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

class Config:
AppName = "Boss Key"
AppVersion = "v2.0.3.0"
AppReleaseDate = "2025-04-05"
AppVersion = "v2.0.4.0"
AppReleaseDate = "2025-04-09"
AppAuthor = "IvanHanloth"
AppDescription = "老板来了?快用Boss-Key老板键一键隐藏静音当前窗口!上班摸鱼必备神器"
AppCopyRight = "Copyright © 2022-2025 Ivan Hanloth All Rights Reserved."
Expand Down Expand Up @@ -49,7 +49,7 @@ class Config:

click_to_hide = True
hide_icon_after_hide = False
path_match = False
path_match = True

hide_binding = []

Expand Down
3 changes: 2 additions & 1 deletion main/core/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ def __eq__(self, other):
return (self.hwnd == other.hwnd and
self.process == other.process and
self.PID == other.PID and
self.title == other.title)
self.title == other.title and
self.path == other.path)
19 changes: 12 additions & 7 deletions main/core/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import datetime
import requests
import json
import pythoncom

from core.model import WindowInfo

Expand Down Expand Up @@ -97,16 +98,20 @@ def changeMute(hwnd,flag=1):
flag=1 mute
"""
try:
hwnd=int(hwnd)
process=win32process.GetWindowThreadProcessId(hwnd)
# 初始化 COM 环境
pythoncom.CoInitialize()
process=win32process.GetWindowThreadProcessId(int(hwnd)) # 获取窗口句柄对应的进程ID
process=psutil.Process(process[1]) # 获取进程对象
# 获取所有音频会话
sessions = AudioUtilities.GetAllSessions()
for session in sessions:
volume = session.SimpleAudioVolume
if session.Process and session.Process.name() == psutil.Process(process[1]).name():
volume.SetMute(flag, None)
break
except:
pass
if session.Process:
if session.Process.ppid == process.ppid() or session.Process.exe() == process.exe() or session.Process.pid == process.pid or session.Process.ppid == process.pid:
volume.SetMute(flag, None)
break
except Exception as e:
print("tools-changeMute: ",e)

def remove_duplicates(input_list: list):
"""
Expand Down