Fix Windows tray startup
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user