Board index » delphi » Including extra icons with the executable

Including extra icons with the executable

I want to include an extra icon (other than the main application icon)
in the executable. I believe you need to do this by putting the icon in
a resource file. But when I did this (in Image Editor), although the
main icon was still used in the actuall application, the new icon was
used for the exe file when viewing it in explorer. I believ it is
because the new icon is first in the executable but why is it the first
one? How do I change the order?

--
Ian Dunn                     I...@polyhedron.com

Polyhedron Software Ltd.        
Programs for Programmers - QA, Compilers, Graphics

************ Visit our Web site on http://www.polyhedron.co.uk/ ************

 

Re:Including extra icons with the executable


Ian Dunn heeft geschreven in bericht ...

Quote
>I want to include an extra icon (other than the main application icon)
>in the executable. I believe you need to do this by putting the icon in
>a resource file. But when I did this (in Image Editor), although the
>main icon was still used in the actuall application, the new icon was
>used for the exe file when viewing it in explorer. I believ it is
>because the new icon is first in the executable but why is it the first
>one? How do I change the order?

You better create a new *.res-file with a name different from the
applications name.

then add

        implementation
        {$R MyResource.Res}

to your source and you'll be able to load the icons, bitmaps or whatever
from the resource-file

TIP :
    take a look at the winApi help-file that ships with delphi one to learn
more about res-files
    take a look at the delphi help : loadfromresourcename,
loadfromresourceid
    ake a look at the win32.hlp : loadbitmap, ......

        GOOD LUCK

Quote

>--
>Ian Dunn                     I...@polyhedron.com

>Polyhedron Software Ltd.
>Programs for Programmers - QA, Compilers, Graphics

>************ Visit our Web site on http://www.polyhedron.co.uk/
************

Re:Including extra icons with the executable


In article <6p565m$r3...@inf6serv.rug.ac.be>, Johnny Slos
<d...@geocities.com> writes

Quote

>Ian Dunn heeft geschreven in bericht ...
>>I want to include an extra icon (other than the main application icon)
>>in the executable. I believe you need to do this by putting the icon in
>>a resource file. But when I did this (in Image Editor), although the
>>main icon was still used in the actuall application, the new icon was
>>used for the exe file when viewing it in explorer. I believ it is
>>because the new icon is first in the executable but why is it the first
>>one? How do I change the order?

>You better create a new *.res-file with a name different from the
>applications name.

>then add

>        implementation
>        {$R MyResource.Res}

>to your source and you'll be able to load the icons, bitmaps or whatever
>from the resource-file

>TIP :
>    take a look at the winApi help-file that ships with delphi one to learn
>more about res-files
>    take a look at the delphi help : loadfromresourcename,
>loadfromresourceid
>    ake a look at the win32.hlp : loadbitmap, ......

>        GOOD LUCK

Thanks, I did this but it still seemed to take the new icon as the icon
for the executable. But I have fixed it now, I think it possibly takes
them in alphabetical order as when I renamed the new icon so that it
came after "MAINICON" it worked correctly but maybe I did something else
and this was just coincidence.
--
Ian Dunn                     I...@polyhedron.com

Polyhedron Software Ltd.        
Programs for Programmers - QA, Compilers, Graphics

************ Visit our Web site on http://www.polyhedron.co.uk/ ************

Other Threads