Click to Rate and Give Feedback
MSDN
MSDN Library
User Interface
Resources
Icons
Icons
Icons An icon is a picture that consists of a bitmap image combined with a mask to create transparent areas in the picture. The term icon can refer to either of the following:
  • A single icon image. This is a resource of type RT_ICON.
  • A group of images, from which the system or an application can choose the most appropriate icon based on size and color depth. This is a resource of type RT_GROUP_ICON.

Overviews

About Icons

This topic discusses icons.

Using Icons

This section provides code samples that show how to perform tasks related to icons.

Functions

CopyIcon

The CopyIcon function copies the specified icon from another module to the current module.

CreateIcon

The CreateIcon function creates an icon that has the specified size, colors, and bit patterns.

CreateIconFromResource

The CreateIconFromResource function creates an icon or cursor from resource bits describing the icon.

To specify a desired height or width, use the CreateIconFromResourceEx function.

CreateIconFromResourceEx

The CreateIconFromResourceEx function creates an icon or cursor from resource bits describing the icon.

CreateIconIndirect

The CreateIconIndirect function creates an icon or cursor from an ICONINFO structure.

DestroyIcon

Destroys an icon and frees any memory the icon occupied.

DrawIcon

The DrawIcon function draws an icon or cursor into the specified device context.

To specify additional drawing options, use the DrawIconEx function.

DrawIconEx

The DrawIconEx function draws an icon or cursor into the specified device context, performing the specified raster operations, and stretching or compressing the icon or cursor as specified.

DuplicateIcon

The DuplicateIcon function creates a duplicate of a specified icon.

ExtractAssociatedIcon

The ExtractAssociatedIcon function returns a handle to an indexed icon found in a file or an icon found in an associated executable file.

ExtractIcon

The ExtractIcon function retrieves a handle to an icon from the specified executable file, DLL, or icon file.

To retrieve an array of handles to large or small icons, use the ExtractIconEx function.

ExtractIconEx

The ExtractIconEx function creates an array of handles to large or small icons extracted from the specified executable file, DLL, or icon file.

GetIconInfo

The GetIconInfo function retrieves information about the specified icon or cursor.

GetIconInfoEx

Retrieves information about the specified icon or cursor. GetIconInfoEx extends GetIconInfo by using the newer ICONINFOEX structure.

LoadIcon

The LoadIcon function loads the specified icon resource from the executable (.exe) file associated with an application instance.

Note  This function hase been superseded by the LoadImage function.
LookupIconIdFromDirectory

The LookupIconIdFromDirectory function searches through icon or cursor data for the icon or cursor that best fits the current display device.

To specify a desired height or width, use the LookupIconIdFromDirectoryEx function.

LookupIconIdFromDirectoryEx

The LookupIconIdFromDirectoryEx function searches through icon or cursor data for the icon or cursor that best fits the current display device.

PrivateExtractIcons

Creates an array of handles to icons that are extracted from a specified file.

Notifications

WM_ERASEBKGND

The WM_ERASEBKGND message is sent when the window background must be erased (for example, when a window is resized). The message is sent to prepare an invalidated portion of a window for painting.

WM_ICONERASEBKGND

Windows NT 3.51 and earlier: The WM_ICONERASEBKGND message is sent to a minimized window when the background of the icon must be filled before painting the icon. A window receives this message only if a class icon is defined for the window; otherwise, WM_ERASEBKGND is sent. This message is not sent by newer versions of Windows.

WM_PAINTICON

Windows NT 3.51 and earlier: The WM_PAINTICON message is sent to a minimized window when the icon is to be painted. This message is not sent by newer versions of Windows, except in unusual circumstances explained in the Remarks.

Structures

ICONINFO

The ICONINFO structure contains information about an icon or a cursor.

ICONINFOEX

Contains information about an icon or a cursor. Extends ICONINFO. Used by GetIconInfoEx.

ICONMETRICS

The ICONMETRICS structure contains the scalable metrics associated with icons. This structure is used with the SystemParametersInfo function when the SPI_GETICONMETRICS or SPI_SETICONMETRICS action is specified.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2010 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker