CImageList::Attach

BOOL Attach( HIMAGELIST hImageList );

Return Value

Nonzero if the attachment was successful; otherwise 0.

Parameters

hImageList

A handle to an image list object.

Remarks

Call this function to attach an image list to a CImageList object.

Example

// The pointer to my image list.
extern CImageList* pmyImageList;
// A handle to an image list that will be attached.
extern HIMAGELIST hmyImageList;

// Attach the image list handle to the CImageList object.
pmyImageList->Attach(hmyImageList);

// Add a new icon to the image list.
pmyImageList->Add(AfxGetApp()->LoadStandardIcon(IDI_QUESTION));

// Detach the handle from the CImageList object.
pmyImageList->Detach();

CImageList OverviewClass MembersHierarchy Chart

See Also   CImageList::Detach, CImageList::GetSafeHandle