Condividi tramite


CHeaderCtrl::GetImageList

Retrieves the handle of an image list used for drawing header items in a header control.

CImageList* GetImageList( ) const;

Return Value

A pointer to a CImageList object.

Remarks

This member function implements the behavior of the Win32 message HDM_GETIMAGELIST, as described in the Windows SDK. The CImageList object to which the returned pointer points is a temporary object and is deleted in the next idle-time processing.

Example

// The new image list of the header control.
m_HeaderImages.Create(16, 16, ILC_COLOR, 2, 2);
m_HeaderImages.Add(AfxGetApp()->LoadIcon(IDI_ICON1));
m_HeaderImages.Add(AfxGetApp()->LoadIcon(IDI_ICON2));    
m_HeaderImages.Add(AfxGetApp()->LoadIcon(IDI_ICON3));

ASSERT(m_myHeaderCtrl.GetImageList() == NULL);

m_myHeaderCtrl.SetImageList(&m_HeaderImages);
ASSERT(m_myHeaderCtrl.GetImageList() == &m_HeaderImages);

Requirements

Header: afxcmn.h

See Also

Reference

CHeaderCtrl Class

Hierarchy Chart

CHeaderCtrl::SetImageList

CHeaderCtrl::CreateDragImage

Other Resources

CHeaderCtrl Members