CHeader

Win32++

CHeader Class

Description

The CHeader class adds support for the header control. A header control is a window that is usually positioned above columns of text or numbers. It contains a title for each column, and it can be divided into parts. The user can drag the dividers that separate the parts to set the width of each column.

Refer to the documentation that ships with the Microsoft Windows Software Development Kit for more information on the use of animation controls. 

CHeader Members

Construction

CHeader
CHeader();
Constructs a header control.   Attributes GetBitmapMargin
int GetBitmapMargin() const;
Gets the width of the bitmap margin for a header control. GetImageList
HIMAGELIST GetImageList() const;
Gets the handle to the image list that has been set for the header control. GetItem
BOOL GetItem(int nPos, HDITEM* pHeaderItem) const;
Gets information about an item in a header control. GetItemCount
int GetItemCount() const;
Gets a count of the items in a header control. GetItemRect
CRect GetItemRect(int nIndex) const;
Gets the bounding rectangle for a given item in a header control. GetOrderArray
BOOL GetOrderArray(LPINT piArray, int iCount);
Gets the current left-to-right order of items in a header control. OrderToIndex
int OrderToIndex(int nOrder) const;
Retrieves an index value for an item based on its order in the header control. SetBitmapMargin
int SetBitmapMargin(int nWidth);
Sets the width of the margin, specified in pixels, of a bitmap in the header control. SetImageList
HIMAGELIST SetImageList(HIMAGELIST himl);
Assigns an image list to the header control. SetItem
BOOL SetItem(int nPos, HDITEM* pHeaderItem);
Sets the attributes of the specified item in a header control.. SetOrderArray
BOOL SetOrderArray(int iCount, LPINT piArray);
Sets the left-to-right order of header items.   Operations ClearAllFilters
int ClearAllFilters();
Clears all of the filters for the header control. ClearFilter
int ClearFilter(int nColumn);
Clears the filter for the header control CreateDragImage
HIMAGELIST CreateDragImage(int nIndex);
Creates a transparent version of an item image within the header control. DeleteItem
BOOL DeleteItem(int nPos);
Deletes an item from the header control. EditFilter
int EditFilter(int nColumn, BOOL bDiscardChanges);
Moves the input focus to the edit box when a filter button has the focus. InsertItem
int InsertItem(int nPos, HDITEM* phdi);
Inserts a new item into the header control. Layout
BOOL Layout(HDLAYOUT* pHeaderLayout);
Retrieves the correct size and position of the header control within the parent window. SetFilterChangeTimeout
int SetFilterChangeTimeout(DWORD dwTimeOut);
Sets the timeout interval between the time a change takes place in the filter attributes and the posting of an HDN_FILTERCHANGE notification. SetHotDivider
int SetHotDivider(CPoint pt);
int SetHotDivider(int nIndex);
Changes the color of a divider between header items to indicate the destination of an external drag-and-drop operation.   Overridables PreRegisterClass
virtual void PreRegisterClass(WNDCLASS &wc);
Set the window class parameters before the window is created.
Base class Members

For base class members, refer to the members of CWnd.

Remarks

A header control can be created as a child window of another control, such as a list box. However, the parent control is not aware of the header control and does not allow for the space taken up by the header, with the result that list items will appear behind the header. If you wish to use a header control in a list box or other control, the parent control must be owner-drawn so that all items are displayed in the correct position.

List view controls already have header controls. Instead of creating a header control for a list view, you use LVM_GETHEADER or ListView_GetHeader to retrieve the existing control.

Summary Information

Header file controls.h
Win32/64 support Yes
WinCE support Yes
Library required Comctl32.lib