Compiling compressed Windows Vista icons
Compiling compressed Windows Vista icons
RealWorld Graphics logo    
Not logged in.  
IndexSoftwareGraphicsArticlesDiscussMore...

What is a ...
How to make a ...
More about ...
compiling Vista icon
editing images
shadow in icons
high DPI in Vista
Video guide on...
Free Online Icon Maker
Icon Shortcut Maker
Search this site using Google

Bookmark this page

del.icio.us iconDel.icio.us
Digg iconDigg it
StumbleUpon iconStumbleUpon
Yahoo MyWeb iconYahoo MyWeb
Furl iconFurl it

Find quality web sites in our directory of Graphics Resources

Tutorials, App Developer, Research, Online Services, Web Design

Is the speed of this web adequate?

Free newsletter
Your email address:

Select background

   

How to compile Windows Vista icons?

January 28th 2006

This article explains basic properties of Windows Vista icons and describes how to use Vista icons in your applications.

Find more information about Vista icons in an article explaining differences between XP and Vista icons.

Vista icons

Windows Vista icons contain a high resolution 256x256 pixels images. These images are used exclusively by Vista and they are stored using PNG-based compression. Explorer dynamically resamples them to required resolution.

An example vista icon with projected shadow
An icon with Vista image format. Large resolution makes it possible to add an additional effect - a projected shadow.
You may download this icon here.

Compiling Vista icons

Although numerous dynamic libraries and executables in the current Vista build contain compressed icons, Visual Studio (including VS2005) resource compiler refuses to accept them and aborts with:
"error RC2176 : old DIB in VistaIcon.ico; pass it through SDKPAINT".

Solution

It is hard to guess when or how is Microsoft going to address this issue. Right now, it is necessary to use alternate resource compiler, manager, or tool.

The following tool was prepared to deal with the problem. It has a very simple command-line interface and you can integrate it into your build process as a post-build step. The tool can replace or add an icon into an executable file using the Windows resource API.

Download the tool from here: ReplaceVistaIcon.exe

The tool accepts two to four arguments:
ReplaceVistaIcon.exe executable.dll icon.ico [icon_ID [language_code]]

Note: If you have an exe file with multiple icons, Windows Explorer uses the first icon as the application icon when browsing folders or in start menu. Compile your application with an XP-compatible icon and then replace it using the tool. Although the tool is able to add new icon into an executable, it would add it at the end of icon list and Windows Explorer would ignore it.

Conclusion

If you have experience with Vista icons in other build environments such as gcc, Delphi, or Builder, please share your knowledge and add a comment below.

Resources

RealWorld Icon Editor homepage.


Recent Comments

Display all comments.

Martin (2007-05-15): It seems that there is indeed no difference between the EXE files. After deleting all Icons in my EXE, Vista still did show the old icon, even after a folder refresh. I am now sure that this is a bug in Vista! To see the new icon, I had to copy the file in the command line to a new name, so the Desktop thinks that it is a new file and does not show the old icon from the internal cache. Now the new icon is shown, thanks a lot for this great tool!

Unknown author (2007-06-10): hi i juz wanna now how to actually use this thing, i am still a newbie to it

Unknown author (2007-06-10): is there any thing dat teach me how to use this thing from the very very early on ?? need deep help, thx

Vlasta (2007-06-10): Well, this article is for software developers trying to solve a certain problem. If you are a developer, you should not have any problems using this tool. Otherwise the question is what you are trying to accomplish...

Unknown author (2007-07-02): So I did the rcdll.dll trick and that didn't work. Could there be a difference since Visual Studio 8 is running on my XP system and not on Vista? I also have two icons, embedded in EXE so thus a challenge...

Vlasta (2007-07-03): Do you have a SP1 for VS2005 installed? That enables compilation of vista icons, but not usage from IDE. That's what the rcdll.dll trick(?) is for.

msdner (2007-12-02): good article

reference:
http://www.msdner.com/windows-networking/

Unknown author (2008-02-18): what about the source code?

Unknown author (2008-02-18): what about the license?

Vlasta (2008-02-19): it can be used for free and source code is on codeproject.com

Add comment

Note: Comments not related to this page or using offensive language will be deleted.

Please login or register before adding comments.


Copyright © 2005-2007 RealWorld Graphics. Contact: info@rw-designer.com.