CImageList::FromHandle

static CImageList* PASCAL FromHandle( HIMAGELIST hImageList );

Return Value

A pointer to a CImageList object if successful; otherwise NULL.

Parameters

hImageList

Specifies the image list.

Remarks

Returns a pointer to a CImageList object when given a handle to an image list. If a CImageList is not already attached to the handle, a temporary CImageList object is created and attached. This temporary CImageList object is valid only until the next time the application has idle time in its event loop, at which time all temporary objects are deleted.

Example

// The handle of my image list.
extern HIMAGELIST hmyImageList;

// Convert the HIMAGELIST to a CImageList*.
ASSERT(hmyImageList != NULL);
CImageList* pmyImageList = CImageList::FromHandle(hmyImageList);
ASSERT(pmyImageList != NULL);

CImageList OverviewClass MembersHierarchy Chart

See Also   CImageList::FromHandlePermanent