Solved

Multiple ICONS on App

Posted on 2002-03-13
9
223 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
Comment Utility
simple add a res-file with additional icons
0
 

Author Comment

by:mgesiot
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 3

Expert Comment

by:SteveWaite
Comment Utility
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
Comment Utility
listening
0
 

Expert Comment

by:CleanupPing
Comment Utility
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
Comment Utility
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
Comment Utility
This question is PAQed and no points refunded (of 100)

YensidMod
Community Support Moderator
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 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

11 Experts available now in Live!

Get 1:1 Help Now