[EMAIL PROTECTED] wrote:
> I tried today to add more than one icon in an EXE file.
> For example I want to embed in my application's EXE file a standard
> icon, a 16x16 pixels icon, a high resolution icon, etc, so the user can
> choose a different icon for its desktop shortcut or to associate
> different file types with my application's icons.

If they're all the same icon, differing only by size or color depth, then
you should put them all in the *same* icon file. Then they'll all be in
the same resource, too, and the OS will select the right one for the right
context. (It will select the 16x16 one for a small icon, and XP will
select one with an alpha channel if it's available.)

> I did all this stuff but I can't select which of these embedded icons is
> the default.
> More precisely, after the compiler builds the application, it will
> assign the first icon (icon number 0) to the generated exe file.
> But how to instruct the compiler which of my icons is the first one?
>
>
> This is my Icons.RC file:
>
> ICON_STANDARD ICON "icons\default 256 transparent standard.ico"
> ICON_SHADOW   ICON "icons\default 256 transparent shade.ico"
> ICON_SETUP    ICON "icons\setup   256 transparent.ico"

Strings in resource scripts are interpretted using C syntax. That means
you need to escape backslashes by doubling them.

> and this is the BAT file that call the resource compiler:

You don't need to invoke the resource compiler yourself. Simply add the RC
file to your Delphi project, and Delphi will compile it when necessary. It
will also link the resulting RES file for you.

> I have tried to change the order of the lines, to put my preferred icon
> first, but the result is the same.

Resources are alphabetized, and the OS always chooses the first icon. And
Delphi always chooses the one named MAINICON. So if you want MAINICON to
be the one Explorer shows for your program, you can't have any icons with
names that come before MAINICON.

-- 
Rob


_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to