HD_ITEM

This structure contains information about an item in a header control. This structure is superseded by the HDITEM structure.

At a Glance

Header file: Commctrl.h
Windows CE versions: 1.0 and later

Syntax

typedef struct _HD_ITEM { hdi
UINT
mask;
int
cxy;
LPSTR
pszText;
HBITMAP
hbm;
int
cchTextMax;
int
fmt;
LPARAM
lParam;
} HD_ITEM;

Members

mask

Indicates which other structure members contain valid data or must be filled in. It can be a combination of the following values:

Value Description
HDI_BITMAP The hbm member is valid.
HDI_FORMAT The fmt member is valid.
HDI_HEIGHT The cxy member is valid and specifies the item’s height.
HDI_IMAGE Version 4.70. The iImage member is valid and specifies the image to be displayed with the item.
HDI_LPARAM The lParam member is valid.
HDI_ORDER Version 4.70. The iOrder member is valid and specifies the item’s order value.
HDI_TEXT The pszText and cchTextMax members are valid.
HDI_WIDTH The cxy member is valid and specifies the item’s width.

cxy

Width or height of the item.

pszText

Pointer to a null-terminated item string. If this member is set to LPSTR_TEXTCALLBACK, the control requests text information for this item by sending an HDN_GETDISPINFO notification message.

hbm

Handle to the item bitmap.

cchTextMax

Length of the item string, in characters.

fmt

Set of bit flags that specify the item’s format.

This member can include one of the following text justification or right-to-left reading order bit flags:

Value Description
HDF_CENTER The item’s contents are centered.
HDF_LEFT The item’s contents are left-aligned.
HDF_RIGHT The item’s contents are right-aligned.
HDF_RTLREADING Text is displayed using right-to-left reading order for Hebrew or Arabic systems.

The flag from the preceding list is combined with one of the following values:

Value Description
HDF_BITMAP The item displays a bitmap.
HDF_BITMAP_ON_RIGHT Version 4.70. The bitmap appears to the right of text. This does not affect an image from an image list assigned to the header item.
HDF_IMAGE Version 4.70. The item displays an image from the image list.
HDF_OWNERDRAW The header control’s owner draws the item.
HDF_STRING The item displays a string.

Additionally, the following flag can be combined with any of the preceding flags:

Value Description
HDF_IMAGE The item displays an image from an image list.

You can use the HDF_JUSTIFYMASK mask to isolate the text justification portion of the fmt member.

lParam

Application-defined item data.

iImage

Zero-based index of an image within the image list. The specified image will be displayed in the header item in addition to any image specified in the hbm member. If iImage is set to I_IMAGECALLBACK, the control requests text information for this item by using an HDN_GETDISPINFO notification message.

iOrder

Order in which the item appears within the header control, from left to right. That is, the value for the far left item is 0. The value for the next item to the right is 1, and so on.

Remarks

The header control can display text, an image, and a bitmap for an item all at the same time. The alignment flags determine the order in which they appear. With HDF_LEFT or HDF_CENTER, the order is image, text, and then bitmap. With HDF_RIGHT the order is bitmap, image, and then text.

See Also

HDM_GETITEM, HDM_INSERTITEM