Solved

Multiple ICONS on App

Posted on 2002-03-13
9
226 Views
Last Modified: 2010-04-05
Hi
If you look on Explorer.exe it holds different icons, so if you link it you can choose an Icon of your choice.
Does any of you know how to do it in delphi ?
I've tried modifying the default RES file and adding a new one, but no results.

Bye
Marco
0
Comment
Question by:mgesiot
9 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6860018
simple add a res-file with additional icons
0
 

Author Comment

by:mgesiot
ID: 6860064
Not really
I tried, both adding more icons to the default RES file or adding a new RES file, but no results.

Ok
I'll try again

Thanks
Marco
0
 
LVL 6

Expert Comment

by:DrDelphi
ID: 6862627
You have to be careful when adding a new resource file that you observe case (at least this has been my experience with NT and 2000). I created a new resource file which included the file MyIcon.ico. The file created was named ikon.RES. When I added the line {$Resource ikon.res}, it doesn't give an error, but it won't find my icon either. Changing the line to read {$Resource ikon.RES} did the trick. Quirky, but true....



Good luck!!
0
 
LVL 3

Expert Comment

by:SteveWaite
ID: 6863334
Don't modify the app res file. Your app should first have the correct icons, read on..

You can have two icons then add whatever else you need in your res files.

The first icon is the low-res/low-color one, the second is the high-res/hi-color one.

So what I currently do is the following:

Add the first icon to your app in the project/options/icon tab. This compiles the smaller/lower color icon into the res file for the app, is the name of your exe and is left alone. You can add your high color icon in a new res file, i.e. Create the .res using brcc32.exe and add the line:
{$R OtherIcon.res}

.. or better still to just add an .rc file to your project which adds the line
{$R 'OtherIcon.res' 'OtherIcon.rc'}
to the application unit.

In the .rc file put the text:
ICON1 ICON  "OtherIcon.ico"

If you delete the res it will be recompiled when you run your app.

Then you get the larger one in the desktop shortcut and the smaller one in the taskbar.

I had a question going about this earlier but got no response. Basically asking if more icons can be added to be automatically selected, it seems not.

if you want more icons to select from then simply add more lines to the .rc file (and make the icons!), be
careful to have different id.'s i.e.

ICON2 ICON  "OtherIcon2.ico"
ICON3 ICON  "OtherIcon3.ico"

etc.

Regards,
Steve

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Expert Comment

by:SteveWaite
ID: 6863345
to add the .rc to your project use project menu/add to project.
the res line is the automatically added to your application unit so do not add {$R OtherIcon.res} anywhere yourself.
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 6863642
listening
0
 

Expert Comment

by:CleanupPing
ID: 9343276
mgesiot:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 7

Expert Comment

by:knightmad
ID: 9470741
Wow, Its been a long time since this comment have been visited!

mgesiot,
No comment has been added lately (19 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:

RECOMMENDATION: PAQ/No Refund

-- Please DO NOT accept this comment as an answer ! --

Thanks,

knightmad
EE Cleanup Volunteer

Remember you (all) can object this recommendation if you disagree, just leave a post here explaining why are you objecting and what should be done instead.
Within 7 days probably this thread will be closed, so, hurry up! : )
0
 

Accepted Solution

by:
YensidMod earned 0 total points
ID: 9536786
This question is PAQed and no points refunded (of 100)

YensidMod
Community Support Moderator
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
proper way to parse text with delphi 7 101
find a node in VST 2 64
select query - oracle 16 95
CheckListBox usage 3 51
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now