-2

I have a .net application that can create lnk shortcuts on the desktop for various purposes (let's say application A creates a shortcut for application B). These shortcuts are independent from this application and I would like to be able to programmatically add an custom icon to this shortcut (the shortcut for application B uses a custom icon not present in A or in B).

I already know how to do with an icon indexed in a dll or a .exe with the WSH library (this is described for example here) but what I want to do is to use a custom .png file.

Has anyone already did this?

Davy
  • 429
  • 2
  • 17
  • 3
    Possible duplicate of [Got .PNG file. Want embeddded icon resource displayed as icon on form title bar](https://stackoverflow.com/questions/154119/got-png-file-want-embeddded-icon-resource-displayed-as-icon-on-form-title-bar) – Balagurunathan Marimuthu Sep 08 '17 at 10:05
  • How do you create shortcut? See [here](https://stackoverflow.com/a/38893182/1997232) a way to specify icon. – Sinatr Sep 08 '17 at 10:07
  • Sorry if my question was unclear, I edited the initial post. This has nothing to do with the icon of a form (but the icon of a lnk shortcut which is a created file), or with an indexed icon in a dll. – Davy Sep 11 '17 at 06:23

1 Answers1

1

I found the answer here: Path to an embedded resource file IconLocation works also for external files.

Davy
  • 429
  • 2
  • 17