Board index » delphi » Component to replace Main Exe Icons ?

Component to replace Main Exe Icons ?


2006-08-23 05:14:38 AM
delphi184
Hello,
I'm searching VCL (free or commercial) to replace main executable icons,
compatible with all icons (32bits and Vista icons).
Thank you.
diAngelo
 
 

Re:Component to replace Main Exe Icons ?

Quote
I'm searching VCL (free or commercial) to replace main executable icons,
compatible with all icons (32bits and Vista icons).
You don't need a component to do that. Simply assign an icon file to
your project containing all formats you want. Many icon editors (like
www.awicons.com/) allow to create all standard formats automatically.
--
Jens Gruschel
www.pegtop.net
 

Re:Component to replace Main Exe Icons ?

"Jens Gruschel" <XXXX@XXXXX.COM>writes
Quote
You don't need a component to do that. Simply assign an icon file to
your project containing all formats you want. Many icon editors (like
www.awicons.com/) allow to create all standard formats
automatically.
If however, you need to replace the main icons in a Delphi executable which
is already built, the source code for Inno Setup contains code to do this.
I found the code structure made it easy to grab just relevent part.
Roger Lascelles
 

Re:Component to replace Main Exe Icons ?

Jens,
Well but how you change executable from your application ?
like InnoSetup ?
Regards,
"Jens Gruschel" <XXXX@XXXXX.COM>a écrit dans le message
Quote
>I'm searching VCL (free or commercial) to replace main executable icons,
>compatible with all icons (32bits and Vista icons).

You don't need a component to do that. Simply assign an icon file to
your project containing all formats you want. Many icon editors (like
www.awicons.com/) allow to create all standard formats
automatically.

--
Jens Gruschel
www.pegtop.net
 

Re:Component to replace Main Exe Icons ?

Quote
but how you change executable from your application ?
Go to Colin Wilsons site www.wilsonc.demon.co.uk/delphi.htm
and get the program to the Delphi Resource Editor (DRED) and the
source code which is on the Delphi 5 page. It will let you do
most anything to application in addition to add/delete/modify
the MainIcon.
 

Re:Component to replace Main Exe Icons ?

Quote
Well but how you change executable from your application ?
like InnoSetup ?
What icon exactly do you want to change? The one shown in Explorer for
the exe, the one shown in Explorer for a .lnk to the exe, the one shown
in the taskbar, the one shown in the form's caption bar or the one of a
file associated with the exe? And when do you want to change it? At
design time or at runtime?
--
Jens Gruschel
www.pegtop.net
 

Re:Component to replace Main Exe Icons ?

I would like to change exe icon directly from my application, I'd like
my user can select ico, like any installer progam.
Regards,
Holger
"Jens Gruschel" <XXXX@XXXXX.COM>a écrit dans le message
Quote
>Well but how you change executable from your application ?
>like InnoSetup ?

What icon exactly do you want to change? The one shown in Explorer for
the exe, the one shown in Explorer for a .lnk to the exe, the one shown
in the taskbar, the one shown in the form's caption bar or the one of a
file associated with the exe? And when do you want to change it? At
design time or at runtime?

--
Jens Gruschel
www.pegtop.net
 

Re:Component to replace Main Exe Icons ?

Below is some code that might be of help to you. I got this from
somewhere else a long time ago, and have not really tested it myself,
but it should work, and I'd expect it to not care if the icon is
Vista or not.
Also, of course, you can set your applications icon using the "Project
/ Options" in Delphi. However, for Vista icons (256x256 png
compressed), I have found there is a bug In Delphi (2006) that does not
allow this, causing goofy errors to surface. So, using the routine
below, or using your install program (InstallShield, Wise, InnoSetup,
etc.) to set the icon is a good way to go.
(Regarding the Delphi bug with VIsta icons, see:
qc.borland.com/wc/qcmain.aspx to vote for the bug report
I submitted...)
Finally, for a very nice icon editor that lets you do Vista icons with
Alpha channels, and has lots of cool tools for an amateur artist like
me to make good icons, check out www.axialis.com/
Hope something here helps.
Carl.
////////////////////////////////////////////////////////////////////////////////
Function CreateShortcut(ExePath,WhereToPlaceShortcut,NameOfShortcut,
LocationOfICOFile:String;OverWriteFlag:Boolean):Boolean;
{
This function creates a Windows shortcut to an exe or other file.
ExePath = Path to the .exe (or other file) that the shortcut links
to.
WhereToPlaceShortcut = The folder where the shortcut will be located,
for
example 'C:\Program Files\...profiles\.....\dekstop'
NameOfShortcut is the name you want for it (i.e. 'Shortcut to ABC')
LocationOfICOFile is the location of the .ico file that is the
graphic for
the icon. For example 'C:\Icons\MyIcon.ico' Set to '' if you don't
want
to specify an icon, but instead prefer to use the default that is
assigned.
Set OverWriteFlag to "False" if you don't want to overwrite an
existing
shortcut.
Result returns True if sucessful, False if no shortcut was actually
created
or overwritten.
This routine requires ActiveX,ShlObj,ComObj to be in uses clause.
IMPORTANT NOTE: You will not get a compiler error if you compile this
without ComObj in the uses clause, but this routine
will
not work!
Example:
GetDesktopFolderLocation(DesktopPath);
CreateShortcut('C:\MyPrograms\MyProgramFolder',DesktopPath,'MyShortCut','C:\MyPrograms\MyICONS\MyIcon.ico');
}
var link:IShellLink;
link_file:IPersistFile;
SaveTo:WideString;
begin
WhereToPlaceShortCut:=WhereToPlaceShortcut+NameOfShortcut;
{Check for existing shortcut.}
if (OverWriteFlag=False) and FileExists(WhereToPlaceShortCut+'.pif')
then
begin
Result:=False;
exit;
end;
Result:=True;
try
CoCreateInstance(CLSID_ShellLink,nil,1,IID_ISHellLinkA,link);
link.SetPath(pchar(ExePath));
if FileExists(LocationOfICOFile) then
begin
{If icon exists, then use it, otherwise don't}
link.SetIconLocation(PChar(LocationOfICOFile),0); // 0 is Icon
Index of zero.
end;
link_file:=link as IPersistFile;
SaveTo:=WhereToPlaceShortCut;
if link_file.Save(PWideChar(saveTo),false)<>S_OK then
Result:=False;
except
Result:=False;
end;
end;
diAngelo writes:
Quote
Hello,

I'm searching VCL (free or commercial) to replace main executable icons,
compatible with all icons (32bits and Vista icons).

Thank you.
diAngelo
 

Re:Component to replace Main Exe Icons ?

Resource Hacker
www.angusj.com/resourcehacker/
Or any other generic resource hacking program
"diAngelo" <XXXX@XXXXX.COM>writes
Quote
Hello,

I'm searching VCL (free or commercial) to replace main executable icons,
compatible with all icons (32bits and Vista icons).

Thank you.
diAngelo