Resource Compiler - ICON Statement (Resource)

Syntax

ICON icon-id  [load-option] [mem-option] [codepage] filename

This form of the ICON statement defines an icon resource for an application. An icon resource, typically created by using Icon Editor , is a bit map defining the shape of the icon to be used for a given application. The ICON statement copies the icon resource from the file specified in the filename field and adds it to the application's other resources.

You can provide any number of ICON statements in a resource script file, but each statement must specify a unique icon-id value.

icon-id
Specifies the icon-resource identifier. This value must be an unsigned integer in the range of 1 through 65535, a simple expression that evaluates to a value in these ranges, or a character string. An icon-id of 1 has a special meaning; for details, see the "Comment" section.
load-option 
Ignored if used in an AIX environment.

Specifies when the system loads the resource from the executable file into memory. This value must be one of the following:

PRELOAD
System loads the resource when the application starts.
LOADONCALL 
System loads the resource when the application calls the WinCreateStdWindow function. This is the default option.
mem-option 
Ignored if used in an AIX environment.

Specifies how the system manages the resource when it is in memory. This value must be one or more of the following:

FIXED
System keeps the resource at a fixed memory location.
MOVEABLE
System moves the resource as necessary to compact memory.
DISCARDABLE 
System discards the resource if it is no longer needed

The default setting is MOVEABLE and DISCARDABLE.

codepage
Ignored if used in an AIX environment.

Specifies an OS/2 code page value.

filename
Specifies the name of the file containing the icon resource. If the file is not in the current directory, filename must be preceded by a full path.

Comments
An icon with an icon-id of 1 is the default icon. The RC program writes the icon not only to the resources in your executable file, but also as the .ICON extended attribute. File Manager will display this icon next to the name of the executable file.

Example
This example defines an icon whose icon identifier is 11. The icon resource is copied from the file custom.ico.

ICON 11 custom.ico


Resource Compiler - ICON Statement (Control)
Resource Compiler - DEFAULTICON Statement
Resource Script Files
Resource Compiler - An Overview