Try OpenEdge Now
skip to main content
ABL Reference
Handle Attributes and Methods Reference : LOAD-ICON( ) method
 

LOAD-ICON( ) method

(Windows only; Graphical interfaces only)
Loads the icon you want from a specified file for display in the title bar of an ABL window, in the task bar, and when selecting a program using ALT+TAB. This method can accommodate icons formatted as small size (16x16) icons, regular size (32x32) icons, or both.
An icon file might contain multiple icons. In those instances when multiple icons are in a file, this method uses the 32x32 icon, if one exists, from the file that you specified. However, if a 32x32 icon does not exist, it uses the first icon in the file.
If the load is successful, this method returns TRUE.
Return type: LOGICAL
Applies to: WINDOW widget

Syntax

LOAD-ICON ( icon-filename [ , n] )
icon-filename
A character-string expression that specifies a full or relative pathname for a file that contains the icon that you want to load for display in the title bar of a window and in the task bar. The pathname can contain Unicode characters. See OpenEdge Development: Internationalizing Applications for more information about Unicode.
In Windows, you can specify a URL pathname for icon-filename. If you specify a fully-qualified URL, LOAD-ICON( ) loads the icon file directly without searching directories or URLs in PROPATH. Valid URL protocols include HTTP and HTTPS.
Note: URL pathnames cannot contain the percent symbol (%). If an error exists in a URL specified on the PROPATH, the LOAD-ICON( ) method continues searching with the next PROPATH entry.
If you specify URL pathnames on the PROPATH and your application repeatedly uses the LOAD-ICON( ) method with a URL pathname, you can improve performance by using the SEARCH function once to determine the full URL pathname to the directory containing the icon files. Use this value to create a fully-qualified URL pathname for icon-filename and avoid repeated searches of the PROPATH.
If you specify an empty string ("") for icon-filename, this method removes the most recently loaded icon.
n
An integer expression that specifies the position of the icon within the file. Only use this expression if you want to override the default behavior.
For example, the following invocation of LOAD-ICON( ) finds the second icon in the icon file file.ico and loads it:
LOAD-ICON("file.ico", 2).
The following invocation removes the previously loaded icon:
LOAD-ICON("").
You typically use this method to load a large icon, primarily for use in the ALT+TAB window for switching applications. ABL has no means of specifying a default icon for this purpose, and Windows provides a generic icon if you do not specify one.
.NET forms allow you to specify a default icon that works for this purpose using the form Icon property, which in OpenEdge is provided by the Progress.Windows.Form class. You can then change this property as required for different uses.
You can maintain uniform icons across .NET forms and ABL windows in an application by using this method to load the same large icon you are using to set the Icon property for .NET forms.

See also

LOAD-SMALL-ICON( ) method