Embedding a second icon into an exe file...
-
Hello experts, I'm applying some finishing touches to one of my applications. The exe's icon was selected via the project's properties, on the "Application" section, where it says "Icon:". Now, if I would create a shortcut to some file, and attempt to change its icon, pointing the icon selection dialog to my exe, the dialog would display the program's icon. Same goes for any other icon sucking program... I'm guessing that the program's icon is embedded in a specific section of the exe, which later gets scanned by the icon selection dialog. How can I embed icons to the exe so they would also be in the same section? Thanks in advance, Shy.
-
Hello experts, I'm applying some finishing touches to one of my applications. The exe's icon was selected via the project's properties, on the "Application" section, where it says "Icon:". Now, if I would create a shortcut to some file, and attempt to change its icon, pointing the icon selection dialog to my exe, the dialog would display the program's icon. Same goes for any other icon sucking program... I'm guessing that the program's icon is embedded in a specific section of the exe, which later gets scanned by the icon selection dialog. How can I embed icons to the exe so they would also be in the same section? Thanks in advance, Shy.
-
Thanks, but it did not work for me... However, I've found my own solution. After compiling the exe file, you open it in VS, either by selecting it via File > Open > File, or by clicking the small "Show all files" icon on the top of the solution explorer, navigating (still in the solution explorer) to the exe file, and double clicking it. In the new opened tab it is possible to import the icon into the already compiled exe. :-D Of course it has to be done EVERY TIME the exe is recompiled, which is quite annoying... :doh: So I'm thinking of learning how to use Post-Build Events... Maybe I could make VS import the icon automatically every time... Well... I hope this post will help others achieve the same goal. I intend to write a small article about this, and maybe combine it with another subject. Hope I'll have the time... :) Regards, Shy.
-
Thanks, but it did not work for me... However, I've found my own solution. After compiling the exe file, you open it in VS, either by selecting it via File > Open > File, or by clicking the small "Show all files" icon on the top of the solution explorer, navigating (still in the solution explorer) to the exe file, and double clicking it. In the new opened tab it is possible to import the icon into the already compiled exe. :-D Of course it has to be done EVERY TIME the exe is recompiled, which is quite annoying... :doh: So I'm thinking of learning how to use Post-Build Events... Maybe I could make VS import the icon automatically every time... Well... I hope this post will help others achieve the same goal. I intend to write a small article about this, and maybe combine it with another subject. Hope I'll have the time... :) Regards, Shy.
Ok I've found out how to do it :jig:
- File | New
- Select Native Resource Template
- Import icons etc you want
- File | Save As (make sure 32-bit resource (*.res) is selected in the File Type combo)
- Save the file somewhere
- Open up the properties pages of your Project, change the radio button by the Application icon to Resource File
- Browse & select the resource file.
- Voila!
This should probably be put into an article at some point since there's no where sensible where this is explained (that I came across)... If I've got time over the weekend I'll do it, unless you want to?
-
Ok I've found out how to do it :jig:
- File | New
- Select Native Resource Template
- Import icons etc you want
- File | Save As (make sure 32-bit resource (*.res) is selected in the File Type combo)
- Save the file somewhere
- Open up the properties pages of your Project, change the radio button by the Application icon to Resource File
- Browse & select the resource file.
- Voila!
This should probably be put into an article at some point since there's no where sensible where this is explained (that I came across)... If I've got time over the weekend I'll do it, unless you want to?
Works perfect! Hehe... I would have never thought of sniffing through the Visual C++ node in the "New File" dialog... ;) That's a lot better than modifying the exe every time you compile it! :-D
Ed.Poore wrote:
If I've got time over the weekend I'll do it, unless you want to?
Go ahead and write the article... :) I'll probably won't find (or should I say take...? ;P) the time to do it myself anyway... Thanks a bunch! Shy.
-
Works perfect! Hehe... I would have never thought of sniffing through the Visual C++ node in the "New File" dialog... ;) That's a lot better than modifying the exe every time you compile it! :-D
Ed.Poore wrote:
If I've got time over the weekend I'll do it, unless you want to?
Go ahead and write the article... :) I'll probably won't find (or should I say take...? ;P) the time to do it myself anyway... Thanks a bunch! Shy.
-
Hehe... Cool! You even got the screen shots and all... :) Voted 5 for the article of course! ;) Well... I guess that now, after solving the problem, I can start coding again and compensate for all of the day time I've lost. Another sleepless night... :laugh: Regards, Shy.
-
Hehe... Cool! You even got the screen shots and all... :) Voted 5 for the article of course! ;) Well... I guess that now, after solving the problem, I can start coding again and compensate for all of the day time I've lost. Another sleepless night... :laugh: Regards, Shy.