Board index » delphi » Component to replace Main Exe Icons ?
diAngelo
Delphi Developer |
diAngelo
Delphi Developer |
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 |
Jens Gruschel
Delphi Developer |
2006-08-23 05:49:47 AM
Re:Component to replace Main Exe Icons ?QuoteI'm searching VCL (free or commercial) to replace main executable icons, www.awicons.com/) allow to create all standard formats automatically. -- Jens Gruschel www.pegtop.net |
Roger Lascelles
Delphi Developer |
2006-08-23 11:45:55 AM
Re:Component to replace Main Exe Icons ?
"Jens Gruschel" <XXXX@XXXXX.COM>writes
QuoteYou don't need a component to do that. Simply assign an icon file to 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 |
Holger
Delphi Developer |
2006-08-23 08:10:55 PM
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, |
Dennis Passmore
Delphi Developer |
2006-08-23 10:15:24 PM
Re:Component to replace Main Exe Icons ?Quotebut how you change executable from your application ? 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. |
Jens Gruschel
Delphi Developer |
2006-08-24 04:21:29 AM
Re:Component to replace Main Exe Icons ?QuoteWell but how you change executable from your application ? 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 |
Holger
Delphi Developer |
2006-08-25 08:37:31 PM
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 ? |
Carl
Delphi Developer |
2006-08-26 01:04:18 AM
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: QuoteHello, |
Ian Boyd
Delphi Developer |
2006-08-29 11:54:46 PM
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 QuoteHello, |