Changing the Icon of exe?

Started by
5 comments, last by Khatharr 11 years, 3 months ago

I've been messing around creating programs lately and I decided to change the icon of my program. I'm using a framework called OpenFrameworks, and it uses GLUT/OpenGL for graphics. I managed to change it by adding a rc script to my Visual Studio project that contains:


GLUT_ICON ICON src/glut.ico

This will change the icon. However, the same icon file will be used universally, so the icon image on the window of my application is shrunk down which causes extreme distortion, and the icon image on my task bar is stretched out. Is there a way to optimize these icons for the different locations they appear? Whether it's via rc scripting or any other route.

Advertisement
A single .ico file can contain multiple images for different resolutions. You just need to find an icon editor that supports this functionality and make the required images for the various necessary resolutions.
Ah such a simple answer I was over thinking, thank you! :)

Pixelformer is a pretty damn good bare-bones icon editor, and supports multiple-resolution icons. YMMV, of course.

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”

Versions of IcoFX before version 2.0 were freeware. You should still be able to find version 1.6.4 online somewhere. It, too, is a lightweight icon editor that supports "packing."

So I've come to a half-solution, but I've become stumped again. I used Greenfish Icon Editor to create an icon with the sizes 16x16, 24x24, 32x32, 64x64, and 256x256. The icon almost works. I attached a picture because it's hard to verbally explain the error. It chooses the right icon for the text console, and the quick bar looks fine, but it looks like the GLUT window is trying to use the same one as the quick bar and it looks bad. My resource script is still the same. Here's what it looks like:

qovpcw.jpg

You can set the small and large icons explicitly in the WNDCLASSEX struct when creating your window class.

void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.

This topic is closed to new replies.

Advertisement