ocp1000
ocp1000

Reputation: 601

Set the exe main program icon from DLL

Here's my problem: I have a .NET application where all my resources (icons, images) are stored in a separate DLL file. Now, while it was easy to retrieve all these resources in run time, I was wondering if there's a way to set the main program icon in the application properties of visual studio (under "Icon and manifest") from the DLL?

Upvotes: 0

Views: 497

Answers (1)

Frank Castle
Frank Castle

Reputation: 21

You can do it manually in Windows Explorer, in the EXE's file properties dialog, that's the only way I know of. But you can also add an icon to the exe itself and Windows Explorer will use it automatically. If you add more than one icon to the EXE, Windows Explorer will use the first one it finds, but you can change it to the one you want in the same way you can set an icon from a DLL.

If you want to do that programatically, e.g. with an installer you provide, use Google to find out how you can determine the appropriate registry entries you need to alter. But be careful, only write to the registry if you REALLY know what you're doing, you might wreck your system otherwise!

Upvotes: 2

Related Questions