• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4139
  • Last Modified:

How can i change another exe icon??

Hello experts,

How can i change another exe icon??
0
plinho
Asked:
plinho
  • 10
  • 7
1 Solution
 
Tom-J-LaelCommented:
Right click .exe file or shortcut to .exe file

select properties

Make sure "shorcut tab" is selected

choose "change icon"

choose your options that are available or browse to a custom ICON file
0
 
plinhoAuthor Commented:
No, i mean via code, i want to make an application that changes others icons
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
plinhoAuthor Commented:
ciuly it isnt necessary madcomponents for this function is it? if not what should i incluse in the uses for TPIconGroup??

and to use it would be just like you posted in that post right?
0
 
2266180Commented:
actually, madcomponents are necessary. but only madbasic if I remember correctly.

the only problem is that if you want to change an unkown icon, then you first need to get the language of the icon you want to change. one way is to use madres and iterate through the icons, or use another component/library that does that.

an alternative (good one) is using collin wilson's units: http://www.wilsonc.demon.co.uk/delphi.htm
you can check out xn resource editor from there. it comes with sources.

the only way around not using other peoples units is to use raw winapi. which can be tricky.

and in the matter madres vs wilsonc ... hard to say. I guess it depends on how/where and what for youa re going to use it. OR on personal preference.
0
 
plinhoAuthor Commented:
Hmm i dont know... what i wanna do is change only the icon of the program itself, i mean in windows explorer, like when you go to Project - Options - Application and change the icon. I mean, jsut this one, it doesnt need to change that little one in the left of form's caption...

What way do you recommend to use??


by the way, i dont really care using others components :p
0
 
2266180Commented:
well ... for starters, you cannto do that.

the icon from the left od the form's caption IS the main icon of the application that appears in windows explorer.

so ... you need to rethink this a little :)
0
 
plinhoAuthor Commented:
hahaha i guess this is a LOT more complicated than i expected ^^

I thought there would be some simple function....

Hmm and to change the own application's icon... i tried Application.icon.loadfromfile something like that... but it only changes the little one in form's caption, the windows explorer's doesnt change :p
0
 
2266180Commented:
obviously, since that method changes the icon at runtime, the one that is loaded in memory for the application itself, not the one from the application file which explorer will display.

the problem is this:
do you reall y want to display another icon in the application forms and another in windows explorer?

if so, then change the application main icon in file using my function above and use the application.icon.loadfrom file with teh icon you want displayed in forms.

if this is not what you want, then tell us more exactly what you want to happen, not what you thin you want to do in code ;)
0
 
plinhoAuthor Commented:
hahaha ok, here it is: The only thing i want to change is the icon from windows explorer.... the form's icons is irrelevant... Hmm, there is no way to change windows explorer icon while application is active right?

Another thing: if it is a lot easier a function to change the OWN application in delphi will do it xD
Imean, a button in project1.exe that changes project1.exe icon... :p
0
 
2266180Commented:
>> Hmm, there is no way to change windows explorer icon while application is active right?

under windows, there isn't :)

>> a button in project1.exe that changes project1.exe icon

as I said above, there is no such method to change a running application content.

but, if the form icon is irrelevant, why not just change the main icon of the project using my function?
0
 
plinhoAuthor Commented:
because i dont know how to use it :p

that was my first question... and it all ended in the question: "which method you said is easier?"
0
 
plinhoAuthor Commented:
I'm downloading madcomponents now ;)
i'll install it and test your function
0
 
2266180Commented:
>> because i dont know how to use it :p

the usage is quite simple and strait forward. you also have a test project in that PAQ.
you want me to copy paste what is tehre, here? it makes no sense to me, but if that is what you want I can do it. (retorical)

so, after you have installed at leasy madbasic, copy that function (the version from the accepted solution) to your unit and call it with the parameters you need (exefile, icon, etc).
and keep in mind that you cannot change the icon of a running appilcation.
0
 
plinhoAuthor Commented:
Hmm when i tested it i got an error Oo

it says: Access violation at address 0044F66D in module 'Project1.exe'.

i used like this: UpdateExeIcon('project2.exe', 'MAINICON', 'myicon.ico', 0);
0
 
plinhoAuthor Commented:
Whow never mind, i typed the icon name worng :p

it worked perfectly!!!

Thanks ciuly
0
 
plinhoAuthor Commented:
Genius
0
 
2266180Commented:
you're welcome :)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 10
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now