GetIcon method

Retrieves a handle to the icon.

 

Syntax

HRESULT retVal = object.GetIcon(fSmallIcon, phIcon);

Parameters

  • fSmallIcon [in]
    Type: BOOL

    TRUE to use an icon appropriate for menus; FALSE to use a large icon.

  • phIcon [out]
    Type: HICON

    The retrieved icon resource.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The following table shows recommended minimum icon sizes expressed in pixels. Each size measures both the icon height and icon width, and depends on both the display resolution and the value of the fSmallIcon parameter.

Display resolution: 96 DPI 120 DPI 144 DPI 192 DPI
fSmallIcon is TRUE 16 px 24 px 24 px 24 px
fSmallIcon is FALSE 32 px 40 px 48 px 64 px

 

See also

IOpenServiceActivity::GetIconPath