Displaying All Comments

Log-in or register.

Go back to article.

Unknown author (2006-12-22 00:00:00):

Delphi up to Version 2006 does not Handle Vista icons natively. But you can use a third party Tool ResEd for Delphi available at www.theunknownones.net to add a Vista icon as application icon.

Unknown author (2007-03-02 00:00:00):

ReplaceVistaIcon doesn't work for me. The EXE (compiled with Delphi 2006) increases it's size about 700 KB, although the ico-file is only about 100 KB. But after that the exe file is corrupt.

Vlasta (2007-03-02 00:00:00):

If you send the .exe to info@rw-designer.com, I will check what has happened.

Unknown author (2007-03-06 00:00:00):

The icon gets replaced in the EXE, but the EXE view still doesn't scale in Vista like the icon itself does. I get the same result whether I use this tool or simply import a Vista icon into the EXE file in Visual Studio. All sizes are there 16x16 up to 256x256, so it looks Ok in VS, but not in the Vista explorer view.

Vlasta (2007-03-06 00:00:00):

Make sure, you icon has all the formats (including 8-bits and 4-bits color depths) and the formats are in correct order (large images first).

Unknown author (2007-04-24 00:00:00):

I don't want to register to post this, but my name is Rick Yorgason, I work at LDA Games, and my email address is rick@firefang.com or rick@ldagames.com (it shouldn't be difficult to ascertain that I'm a real person with all that info!)

What I did to bypass this problem is to download the latest beta of the express version of Orcas (aka Visual Studio 9), and copy rcdll.dll from the "Microsoft Visual Studio 9.0/VC/bin" directory to "Microsoft Visual Studio 8/VC/bin". Everything seems to be working so far.

Unknown author (2007-05-13 00:00:00):

Hi, my name is Martin (info2007 at hypermake dot de) and your tool seems to work fine with different EXE files. But if I create a Vista icon with the IcoFX program and turn compression on (this is the default value), the icon of the modified EXE program is not shown. The size of the EXE files increases about 200 kB without compression and only 10 kB with compression, so compression would be nice. Any idea?

Vlasta (2007-05-14 00:00:00):

Make sure that your icon contains all the necessary image formats and they are in correct order - compare your icon with the one displayed above (you can download it by clicking the link below the image).

Martin (2007-05-14 00:00:00):

that's me again. I continued my trials with your sample icon (yes, I really had not created the classic smaller icons with 48x48, 32x32 and 16x16 in the new ico file). Now the icons are shown correctly on 2000/XP, but Vista grabs my very old 32x32 icon which is still part of the exe file. I repeated the trial with the original Win2000 Notepad.exe file and all works fine. So it seems that there are problems with my exe file created with old win32 Borland C 5 which creates pure and simple win32 binaries. Any hints? (The exe file is 4allCalc calculator, see www.hypermake.com) I get the same problem with the exe binaries of another programming environment (www.wdsibyl.org), a crossplatform Delphi clone.

Vlasta (2007-05-14 00:00:00):

As long as the binary is 32-bit, there should be no problems regardless the used compiler. I looked at your exe and there are 2 icons, one with numeric and one with string ID. To be on the safe side, I would only use numeric IDs and the main application icons should be the first icon in the exe and have lowest ID. Maybe Vista sorts the icons differently.

Martin (2007-05-15 00:00:00):

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 00:00:00):

hi i juz wanna now how to actually use this thing, i am still a newbie to it

Unknown author (2007-06-10 00:00:00):

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 00:00:00):

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 00:00:00):

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 00:00:00):

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.

Unknown author (2008-02-18 00:00:00):

what about the source code?

Unknown author (2008-02-18 00:00:00):

what about the license?

Vlasta (2008-02-19 00:00:00):

it can be used for free and source code is on codeproject.com

Unknown author (2008-10-20 00:00:00):

In Delphi 2009 you are able to chose which resource compiler you want to use. If you select the "Microsoft resource compiler" from Delphi, you will be able to compile Vista icons in your Delphi app without any extra work.

Unknown author (2009-02-10 20:47:34):

Install the latest Microsoft Windows SDK - http://www.microsoft.com/downloads/details.aspx?FamilyID=4377f86d-c913-4b5c-b87e-ef72e5b4e065&displaylang=en
then run VCIntegrate. This should fix the Vista compilation problem

Unknown author (2009-05-06 18:07:20):

This tool (ReplaceVistaIcon) works fine, but it does break our debugging process. Since our EXEs are created with VB6 (don't ask), we have to use ReplaceVistaIcon by hand. Then the EXE's modification date doesn't match the PDB's modification date, and the debugger won't recognize the symbols. An option to preserve the modification date would be useful to us...

Vlasta (2009-05-07 01:09:52):

I have put the source code for this tool to CodeProject web site. It should not be hard to add the date preservation bits. (Or can you just debug without the icons?)

Unknown author (2010-01-05 16:03:31):

Your program puts in padding stuff like "PADDINGXX". I think it is much smarter to pad with zeroes (will compress better anyway).

As for Delphi 2009, Delphi 2010, C Builder 2009, C Builder 2010 - the built in resource compiler can build programs with Borland Resource Compiler (brcc32.exe) and with Windows SDK Resource Compiler they both work but ONLY for uncompressed icons.

Vista 256x256 icon features PNG compression and Delphi/Borland compiler seems to have issues with PNG compressed icons. So if you use tools like IcoFX, RealWorld Icon Editor or IconWorkshop to create your icons, you must remember to turn of PNG compression support for 256x256 icons otherwise you will be able to compile them into your application but they will not be shown properly on Vista / Win7.

Having uncompressed icon will increase your application size of course, but if you are packing it with some compressor later (zip, rar, nsis installer...) it will actually compress better so it will be larger file when installed but smaller when in installer archive if you use uncompressed icon (although, this is not a rule, PNG compression can sometimes make things smaller).

Telecetera (2010-01-15 08:53:02):

Thanks to all contributors, we should have solved our problem, but haven't.

We use D2007 on W7 64-bit. We grabbed a working, resizable icon from the desktop using IcoFx, switch off PNG compression and saved it. Added it as the only icon to a simple Delphi app using Project\Options\Application\Icon, then ran ReplaceVistaIcon ourapp.exe savedicon.ico, and could see the resultant increase in size. Noting comments about replacing versus adding, we also tried adding 0 and 1 as a third parameter.

No dice, any ideas?

Vlasta (2010-01-15 10:35:54):

Caching in Explorer? Try making a copy of the exe after running the tool...

Unknown author (2010-04-28 04:29:39):

Can you provide a link to the source code? I can't find it in codeproject.

Unknown author (2010-10-14 22:46:19):

I use delphi 2007.. and have windows 7 x64... I have the icons working like this..

I use icoFX to create a multi layer icon.. eg the different size icons are in one .ico file.. 256x256, 48x48, 32x32 and 16x16. Save as 159.ico.

Create a new resource script file (resources\setup.rc) and add:
#define ICON_1 159
ICON_1 ICON "159.ico"

Compile script with rc.exe

Comment out the default resource file (.RES) from your delphi project file (PROJECT/VIEW SOURCE), and add your new one created from the .rc file that has the icon info in it.

//{$R *.res}
{$R .\resources\setup.res}

This stops delphi from using the default icon definded in the project.
Then add this line after Application.Initialiation;

Application.Icon.Handle := LoadIcon( hInstance, '#159' );

Windows Vista and 7 can now display what ever icon it wants.

Hope this helps..

Unknown author (2010-11-18 11:45:51):

Is there any information available on the return codes for replaceVistaIcon?

Vlasta (2010-11-18 11:47:02):

the usual - 0=success, 1=failure

Unknown author (2013-03-10 19:20:05):

Thank s for the tool I still have some tools built with delphi 6. I can now solve my icon problem on Win Vista/7/8 instead replace manually my app icon after each build :-) :-)

Unknown author (2013-05-20 21:18:50):

does it work on windows 7?

Vlasta (2013-05-20 21:19:54):

yes

Unknown author (2013-05-20 21:40:30):

thank you very much sir

Unknown author (2016-01-10 13:26:08):

Hi! With MinGW apps targeting 32 bit ReplaceVistaIcon break debug information (application that is processed with ReplaceVistaIcon crashes gdb).

Unknown author (2020-07-17 18:39:03):

C:-( HMMMMMMMMMMMM I DON'T NO

Go back to article.