Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you change the .exe icon?

Status
Not open for further replies.

MrMajik

IS-IT--Management
Apr 2, 2002
267
0
0
I compiled my program with an icon associated to the .exe file. Now I want to change that icon but everything I try does nto work and the original icon is still showing up when I compile the project.

Any ideas on how to make this change?



Thank you.

MrMajik

Everything should be made as simple as possible, but not simpler
--Albert Einstein


 
In VB, go to "Project" - > "Properties." Under the "Make" tab is an option for what icon to use.
Brett (smsforce)

--------------------------
Please visit my website!
 
smsforce; I tried that and the icon I want is there and selected but it is not the icon that shows up on the .exe file...

Now what?

Thank you.

MrMajik

Everything should be made as simple as possible, but not simpler
--Albert Einstein


 
I'm sorry. I don't think I can help you further. That works every time for me. :(
Brett (smsforce)

--------------------------
Please visit my website!
 
Try to recompile the exe file with a different name...
 
After editing every file using Notepad and searching I came up empty. Then I went looking around at the code one more time, tried forcing the icon to change with code and am still getting the same icon. I created a new project in a different directory three times and imported the files into it with the same results.

I tried adding a new form and associating an icon to it and then make that the .exe icon. This did not work.

Tried removing the icon image file from the .res file and it still appears.

The weather is great today. Anyone for a game of golf?

Thank you.

MrMajik

Everything should be made as simple as possible, but not simpler
--Albert Einstein


 
What happens if you just create a brand new project ("Hello World" in a msgbox with one command button) and compile it? What icon shows up? If it's the vb icon, try changing it and see what happens. Maybe it's something in the registry.
Brett (smsforce)

P.S. Golf (or anything outdoors) sounds good to me. :)

--------------------------
Please visit my website!
 
Good idea. I gave it a try using my troubled icon image and was able to successfully change the icon to whatever I wanted and back again.

This is one for the Microsoft "How Did We Get This to Happen?" Team.

There is a solution for this. The mystery is...where?

Thank you.

MrMajik

Everything should be made as simple as possible, but not simpler
--Albert Einstein


 
have you tried creating a shortcut to the exe and using the change icon button in the link properties.

This will show whether the correct icon is being stored in the exe

Take Care

Matt
If at first you don't succeed, skydiving is not for you.
 
mattKnight; Your idea put me on the right track...

After checking the icon for the .exe shortcut I found that every icon image stored in the .exe is sorted by name. My icon is the first one in the group. When I remove this icon the next icon that takes the lead position in the .exe file becomes the .exe icon.

To correct this problem I loaded the icon I want as the .exe icon in the .res file and gave it a name so it would be at the top of the name list. Then I pointed the icon property in that form to that icon and coded in into the form's code.

This is a crazy way to spend most of your workday :)

Thanks to smsforce and mattKnight for your help!

Thank you.

MrMajik

Everything should be made as simple as possible, but not simpler
--Albert Einstein


 
Great! Glad it got worked out. The best way I know to make something show up as first in an alphabetical list is to start it with an underscore ("_"). i.e. _icon.ico
Glad to be of help (and see the solution!) :)
Brett (smsforce)

--------------------------
Please visit my website!
 
Sounds like a confused VB IDE to me. You should just be able to go to Form1 (or whatever you named the main form) and change the Icon property to the file you want. It's a shame you had to go thru all that. I would've created a new project and cut/pasted the code, then remade the forms. Probably would've been easier in the long run. lol

There's no chr$(27)!
 
cgfiend; About every 10 minutes I considered doing just that. However, it would have taken a couple hours to redo the form and I kept thinking this is has to be a simple 5-minute fix. Ya, right. However, in the process I learned a thing or two so it was worth it.

Thank you.

MrMajik

Everything should be made as simple as possible, but not simpler
--Albert Einstein


 
It's possible to start two IDE's separate from each other and copy/paste controls. I've done it before.

CGFiend
[There's no chr$(27)!]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top