Fix Windows tray startup

This commit is contained in:
2026-07-31 21:33:36 +08:00
parent 370a94749a
commit 983c3e1dfd
3 changed files with 14 additions and 5 deletions
+3 -4
View File
@@ -42,14 +42,13 @@ func newApp(mw *walk.MainWindow, appDir string, cfg Config, cache *CacheIndex) (
if err != nil {
return nil, err
}
icon, err := walk.NewIconFromSysDLL("shell32.dll", 4)
icon, err := walk.NewIconFromSysDLL("shell32", 4)
if err != nil {
ni.Dispose()
return nil, fmt.Errorf("加载托盘图标: %w", err)
icon = walk.IconApplication()
}
if err := ni.SetIcon(icon); err != nil {
ni.Dispose()
return nil, err
return nil, fmt.Errorf("设置托盘图标: %w", err)
}
if err := ni.SetToolTip(appName + " - 右键打开菜单"); err != nil {
ni.Dispose()