shortcut icons

This commit is contained in:
seraphima
2024-06-12 13:16:34 +02:00
parent a5b69d9be5
commit 80f4611b0a
4 changed files with 183 additions and 245 deletions

View File

@@ -145,8 +145,12 @@ namespace ProjectsEditor.ViewModels
shortcut.TargetPath = Path.Combine(basePath, "ProjectsLauncher.exe");
shortcut.Arguments = '"' + project.Id + '"';
shortcut.WorkingDirectory = basePath;
string iconFilename = DrawHelper.CreateShortcutIcon(project, out Bitmap bitmap);
shortcut.IconLocation = iconFilename;
string shortcutIconFilename = (string)shell.SpecialFolders.Item(ref shDesktop) + $"\\{project.Name}.ico";
Bitmap icon = ProjectIcon.DrawIcon(ProjectIcon.IconTextFromProjectName(project.Name));
ProjectIcon.SaveIcon(icon, shortcutIconFilename);
shortcut.IconLocation = shortcutIconFilename;
shortcut.Save();
}