添加单实例限制、应用图标、移除托盘设置菜单、快捷键暂停/恢复功能
单实例限制:通过命名Mutex和窗口消息广播确保只能运行一个实例,再次启动时唤起已有窗口 应用图标:exe文件嵌入app.ico,托盘和窗口图标统一使用该图标文件 移除托盘右键菜单中与显示主界面重复的设置选项 快捷键暂停/恢复:托盘菜单和主界面侧边栏均添加切换按钮,通过MainViewModel.IsHotKeyEnabled双向同步
This commit is contained in:
@@ -16,6 +16,8 @@ public class HotKeyManager
|
||||
private readonly ILogService _logService;
|
||||
private readonly IProcessExecutionService _processService;
|
||||
|
||||
public bool IsEnabled { get; set; } = true;
|
||||
|
||||
// ──────────────── Win32 API ────────────────
|
||||
|
||||
private const int WM_HOTKEY = 0x0312;
|
||||
@@ -103,6 +105,7 @@ public class HotKeyManager
|
||||
public bool TryHandleMessage(int msg, IntPtr wParam, IntPtr lParam)
|
||||
{
|
||||
if (msg != WM_HOTKEY) return false;
|
||||
if (!IsEnabled) return true;
|
||||
|
||||
int id = wParam.ToInt32();
|
||||
if (_hotkeyMap.TryGetValue(id, out var tool))
|
||||
|
||||
Reference in New Issue
Block a user