From b1687d7be988bb9f3e3d4a21280c80af26d1ae0d Mon Sep 17 00:00:00 2001 From: Ivan Hanloth Date: Wed, 9 Apr 2025 19:35:50 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E7=A6=81=E9=9F=B3=E5=BA=94=E7=94=A8=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/core/tools.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main/core/tools.py b/main/core/tools.py index 9c0322f..72476cb 100644 --- a/main/core/tools.py +++ b/main/core/tools.py @@ -8,6 +8,7 @@ import datetime import requests import json +import pythoncom from core.model import WindowInfo @@ -97,16 +98,18 @@ def changeMute(hwnd,flag=1): flag=1 mute """ try: + # 初始化 COM 环境 + pythoncom.CoInitialize() hwnd=int(hwnd) process=win32process.GetWindowThreadProcessId(hwnd) sessions = AudioUtilities.GetAllSessions() for session in sessions: volume = session.SimpleAudioVolume - if session.Process and session.Process.name() == psutil.Process(process[1]).name(): + if session.Process and session.Process.name() == psutil.Process(process[1]).name() or session.Process.pid == process[1]: volume.SetMute(flag, None) break - except: - pass + except Exception as e: + print(e) def remove_duplicates(input_list: list): """ From 20cdf8bbb658fdeb3c8529e3807dae42dbd7b7a3 Mon Sep 17 00:00:00 2001 From: Ivan Hanloth Date: Wed, 9 Apr 2025 20:18:24 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=BE=E7=BD=AEGUI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/GUI/setting.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/main/GUI/setting.py b/main/GUI/setting.py index 4bab24d..25e9d1a 100644 --- a/main/GUI/setting.py +++ b/main/GUI/setting.py @@ -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) From c8a5ddf816e9abd6693a31a62a3750dfd1afbc1f Mon Sep 17 00:00:00 2001 From: Ivan Hanloth Date: Wed, 9 Apr 2025 20:35:45 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/core/config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/core/config.py b/main/core/config.py index 4f3dee2..ca9c19f 100644 --- a/main/core/config.py +++ b/main/core/config.py @@ -8,8 +8,8 @@ class Config: AppName = "Boss Key" - AppVersion = "v2.0.3.0" - AppReleaseDate = "2025-04-05" + AppVersion = "v2.0.3.1" + AppReleaseDate = "2025-04-09" AppAuthor = "IvanHanloth" AppDescription = "老板来了?快用Boss-Key老板键一键隐藏静音当前窗口!上班摸鱼必备神器" AppCopyRight = "Copyright © 2022-2025 Ivan Hanloth All Rights Reserved." @@ -49,7 +49,7 @@ class Config: click_to_hide = True hide_icon_after_hide = False - path_match = False + path_match = True hide_binding = [] From 857cd0050c4e16585e65020864ba0668f741f9e3 Mon Sep 17 00:00:00 2001 From: Ivan Hanloth Date: Wed, 9 Apr 2025 20:36:00 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=AF=94=E8=BE=83?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/core/model.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main/core/model.py b/main/core/model.py index 1f42fa5..e9d76a5 100644 --- a/main/core/model.py +++ b/main/core/model.py @@ -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) \ No newline at end of file + self.title == other.title and + self.path == other.path) \ No newline at end of file From c9595fd079f20eec724b4e662c402a83b6fd2c32 Mon Sep 17 00:00:00 2001 From: Ivan Hanloth Date: Wed, 9 Apr 2025 20:41:30 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E9=9D=99=E9=9F=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/core/tools.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/main/core/tools.py b/main/core/tools.py index 72476cb..b4c6f84 100644 --- a/main/core/tools.py +++ b/main/core/tools.py @@ -100,16 +100,18 @@ def changeMute(hwnd,flag=1): try: # 初始化 COM 环境 pythoncom.CoInitialize() - hwnd=int(hwnd) - process=win32process.GetWindowThreadProcessId(hwnd) + 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() or session.Process.pid == process[1]: - volume.SetMute(flag, None) - break + 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(e) + print("tools-changeMute: ",e) def remove_duplicates(input_list: list): """ From 4899a80dc1234b232c54f06be6a11fd584abaacb Mon Sep 17 00:00:00 2001 From: Ivan Hanloth Date: Wed, 9 Apr 2025 20:43:44 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 +++++ main/core/config.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 019f039..5d6ae1e 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,11 @@ Boss-Key - 无法隐藏部分游戏窗口,可能由于游戏窗口加密导致 ## 更新日志 +**V2.0.4 (更新于2025/4/9)** +- 修复无法正确禁音应用的问题 +- 优化选项提示 +- 优化禁音匹配规则 + **V2.0.3 (更新于2025/4/5)** - 新增文件路径匹配选项 - 新增窗口恢复工具 diff --git a/main/core/config.py b/main/core/config.py index ca9c19f..ad40c73 100644 --- a/main/core/config.py +++ b/main/core/config.py @@ -8,7 +8,7 @@ class Config: AppName = "Boss Key" - AppVersion = "v2.0.3.1" + AppVersion = "v2.0.4.0" AppReleaseDate = "2025-04-09" AppAuthor = "IvanHanloth" AppDescription = "老板来了?快用Boss-Key老板键一键隐藏静音当前窗口!上班摸鱼必备神器"