rc.hlp (Table of Contents; Topic list)
ICON resource (1.2)
Icon control                                        Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
 
              The Resource Compiler ICON Statement (Resource)
 
ICON icon-id [load-option] [mem-option] filename
 
This form of the ICON statement defines an icon resource for an application.
An icon resource, typically created by using the MS OS/2 Icon Editor, is a
bitmap 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. An icon
resource can be loaded when creating a window by using the
WinCreateStdWindow function with the FS_ICON style.
 
You can provide any number of ICON statements in a resource-definition file,
but each statement must specify a unique icon-id value.
 
Field        Description
────────────────────────────────────────────────────────────────────────────
 
icon-id      Specifies the icon-resource identifier. This value must be an
             integer in the range 0 through 65,535, or a simple expression
             that evaluates to a value in that range. An icon-id of 1 has a
             special meaning; for details, see the "Comments" section.
 
load-option  Specifies when the system loads the resource from the
             executable file into memory. This value must be one of the
             following:
 
             Value       Meaning
             ───────────────────────────────────────────────────────────────
             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 value.
 
mem-option   Specifies how the system manages the resource when it is in
             memory. This value must be one or more of the following:
 
             Value        Meaning
             ───────────────────────────────────────────────────────────────
             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.
 
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
 
See Also
 
BITMAP, POINTER, WinCreateStdWindow
 
                                      ♦