Board index » delphi » Program Icon Not Shown in Properties

Program Icon Not Shown in Properties

I have a program to which I have allocated an icon, both in Project | Options
and Object Inspector | Form.Icon. I have also allocated version information.

The icon file has six icons in it for 16 x 16, and for 32 x 32 sizes for each
of 16-colour, 256-colour and 24-bit TrueColor.

In Windows explorer and when running the application, correct icons are shown.
But when I right-click and select Properties on the file in Windows Explorer,
the default Delphi flaming torch icon is displayed in the Properties dialog.

That false icon is also displayed in an over-write confirmation dialog when
copying the file with right-click copy/paste. However in this case the correct
icon is shown for the file being overwritten, but not for the file which is
overwriting.

I am using 24-bit TrueColor on my monitor.

Any suggestions would be welcome.

Alan Lloyd
[email protected]

 

Re:Program Icon Not Shown in Properties


"AlanGLLoyd" <[email protected]> skrev i melding
news:[email protected]

Quote
> I have a program to which I have allocated an icon, both in Project |
Options
> and Object Inspector | Form.Icon. I have also allocated version
information.

> The icon file has six icons in it for 16 x 16, and for 32 x 32 sizes for
each
> of 16-colour, 256-colour and 24-bit TrueColor.

> In Windows explorer and when running the application, correct icons are
shown.
> But when I right-click and select Properties on the file in Windows
Explorer,
> the default Delphi flaming torch icon is displayed in the Properties
dialog.

> That false icon is also displayed in an over-write confirmation dialog
when
> copying the file with right-click copy/paste. However in this case the
correct
> icon is shown for the file being overwritten, but not for the file which
is
> overwriting.

> I am using 24-bit TrueColor on my monitor.

I believe you have tried deleting the project's .res file ?

--
Bj?rge S?ther
[email protected]_itte.no

Re:Program Icon Not Shown in Properties


In article <[email protected]>, "Bj?rge S?ther"

Quote
<[email protected]_itte.no> writes:
>I believe you have tried deleting the project's .res file ?

I hadn't, but deleting the .dpr .res, and the .exe, and then re-allocating the
non-Delphi icon, and re-compiling, made no difference.

It shows the correct icon on the .exe, correct icon in Project | Options |
Application > Icon, but not for Right-Click | Properties of the .exe.

Alan Lloyd
[email protected]

Re:Program Icon Not Shown in Properties


"AlanGLLoyd" <[email protected]> skrev i melding
news:[email protected]

Quote
> In article <[email protected]>, "Bj?rge S?ther"
> <[email protected]_itte.no> writes:

> >I believe you have tried deleting the project's .res file ?

> I hadn't, but deleting the .dpr .res, and the .exe, and then re-allocating
the
> non-Delphi icon, and re-compiling, made no difference.

> It shows the correct icon on the .exe, correct icon in Project | Options |
> Application > Icon, but not for Right-Click | Properties of the .exe.

There is some mumbo-jumbo going on with Windows here. I've seen it, I
believe. Try to restart Windows. Try to "browse" the icons of the .exe file.
What I have seen, is that Windows stores the previous icons in some strange
way. It displays an Icon that's no longer present in the .exe. Why ? Don't
know.

--
Bj?rge S?ther
[email protected]_itte.no

Re:Program Icon Not Shown in Properties


In article <J%[email protected]>, "Bj?rge S?ther"

Quote
<[email protected]_itte.no> writes:
>There is some mumbo-jumbo going on with Windows here. I've seen it, I
>believe. Try to restart Windows. Try to "browse" the icons of the .exe file.
>What I have seen, is that Windows stores the previous icons in some strange
>way. It displays an Icon that's no longer present in the .exe. Why ? Don't
>know.

Indeed some mumbo-jumbo, today (perhaps after re-starting windows) it works OK,
and not only works OK on the recompiled file, but also on the two which were
wrong and were deleted yesterday, and are in the recycle bin ! !.

OTOH the .dpr .res file has no icon in it just a unicode identifier - MAIN ICON
- and a  100 or so bytes. I guess it must be a reference. And the .res
unusually has a big batch of empty-ish space (500 bytes) before the identifier.

Came across an interesting bit of info in MSDN on how windows chooses
particular icons (although dated 1995, its in the latest library under "Icons
in Win32" by John Hornick), part of this is as follows ...

"Which Icon?
If an .EXE or .DLL file has only one RT_GROUP_ICON resource, the first step is
trivial; Windows simply uses that resource. However, if more than one such
group resource exists in the file, Windows must decide which one to use.
Windows NT simply chooses the first resource listed in the application's RC
script. On the other hand, Windows 95's algorithm is to choose the
alphabetically first named group icon if one exists. If one such group resource
does not exist, Windows chooses the icon with the numerically lowest
identifier. So, to be sure that a particular icon is used for an application,
the developer should insure that both of the following criteria are met:
1. The icon is placed before all other icons in the RC file.

2. If the icon is named, its name is alphabetically before any other named
icon, otherwise its resource identifier is numerically smaller than any other
icon.
Which Image?
Once an RT_GROUP_ICON is chosen, the individual icon image, or RT_ICON
resource, must be selected and extracted. Again, if there exists only one
RT_ICON resource for the group in question, the choice is trivial. However, if
multiple images are present in the group, the following selection rules are
applied:
1. The image closest in size to the requested size is chosen.

2. If two or more images of that size are present, the one that matches the
color depth of the display is chosen.

3. If none exactly match the color depth of the display, Windows chooses the
image with the greatest color depth without exceeding the color depth of the
display.

4. If all the size-matched images exceed the color depth of the display, the
one with the lowest color depth is chosen.

5. Windows treats all color depths of 8 or more bpp as equal. For example, it
is pointless to have a 16x16 256 color image and a 16x16 16bpp image in the
same resource-Windows will simply choose the first one it encounters.

6. When the display is in 8bpp mode, Windows will prefer a 16 color icon over a
256 color icon, and will display all icons using the system default palette. "

Point 5 above seems appropriate to my (ignorant) usage of 256-Color _and_
TrueColor icons.

Ah well, its OK now. All part of "Life's Rich Tapestry" I suppose <g>

Alan Lloyd
[email protected]

Other Threads