views:

35

answers:

3

Hey everybody,

I'm building a program in C++ (target is windows XP) using Visual Studio 2008 and I'm trying to add application icons, the ones that show up in the taskbar, explorer, desktop, etc. My .ico file has the sizes 48x48, 32x32, 24x24, and 16x16 pix in color depths 32-bit, 24-bit, 256 colors, and 16 colors. For what it's worth, I'm adding the .ico file to the binary in IcoFX.

I can get all the icons to show up like they should except for the one in the upper left corner of the program itself--the one that you can click on to bring up a menu with window size options--it still shows the default icon.

To get this little icon to change do I need a different image size or is there a completely different way of managing this one icon? Does that icon even have a specific name?

Thanks for your help.

+1  A: 

Duplicated: http://stackoverflow.com/questions/320677/how-do-i-set-the-icon-for-my-application-in-visual-studio-2008

According to one answer on that thread, you need to make sure that your icon is the first icon in the resources file.

gustavogb
A: 

Yes, when I try and add it in VS, I make sure it's the first .ico file. I even tried naming the .rc file and the .ico file the same name as the app. Whether I do any of these things or add the .ico file with IcoFX, all the icons get changed EXCEPT that one in the corner of the window.

Justin
A: 

Ok, I've figured it out:

I'm using wxWidgets as my GUI toolkit, so this is the only satisfactory answer I can give. wxWidgets has classes to set the main frame icons, those classes include wxIcon and wxIconBundle. Then wxTopLevelWindow::SetIcons can be used to set the application's icons. This sets ALL the icons (taskbar, main frame, alt-tab chooser, etc), no need to mess with a resource file in Visual Studio.

Justin