Windows CE enables you to use image lists in header controls, as well as text and bitmaps. An image list is a collection of same-size images, such as bitmaps or icons.
You can use the HDM_SETIMAGELIST message to associate an image list with a header control. Use the HDM_GETIMAGELIST message to retrieve the handle to the image list associated with a header control. To display an image with a header control item, specify HDI_IMAGE as the mask member, HDF_IMAGE as the fmt member, and the zero-based index of an image in the list as the iImage member of the HDITEM structure that you use to add the item to the header control.
Header controls support callback requests for text and images in header control items. To create a callback item, set the pszText member to LPSTR_TEXTCALLBACK or the iImage member to I_IMAGECALLBACK in the HDITEM structure that you fill in when you add the item to the header control. This causes the header control to send the HDN_GETDISPINFO notification message when the item is about to be drawn. The lParam of the WM_NOTIFY message is a pointer to an NMHDDISPINFO structure. When the header control sends the notification, it sets the NMHDDISPINFO structure's members to specify the type of information it needs in order to draw the item. Return the requested information to the header control by filling in the appropriate members of the structure. If you set the mask member to HDI_DI_SETITEM, the header control stores the information and does not request it again. Otherwise, the header control sends the NMHDDISPINFO notification each time the item is redrawn.
Header controls also support drag-and-drop features. To create a header control that supports drag-and-drop operations, specify the HDS_DRAGDROP style when you create the header control. You can also customize a header control's drag-and-drop behavior by handling the HDN_BEGINDRAG and HDN_ENDDRAG notification messages and by sending HDM_CREATEDRAGIMAGE and HDM_SETHOTDIVIDER messages.
You can support custom ordering of items in a header control by setting the iOrder member in the HDITEM structure when you add an item to a header control and by using the HDM_GETORDERARRAY, HDM_SETORDERARRAY, and HDM_ORDERTOINDEX messages.
Header controls support the custom draw service, which gives the ability to customize the appearance of a header control. If a header control provides this service, it sends the NM_CUSTOMDRAW notification at specific times during drawing operations. The lParam of the NM_CUSTOMDRAW notification is a pointer to an NMCUSTOMDRAW structure, which contains the information necessary to draw the customized header control.