HDITEMHDITEM*
*Contents  *Index  *Topic Contents
*Previous Topic: HDHITTESTINFO
*Next Topic: HDLAYOUT

HDITEM


typedef struct _HDITEM {
    UINT    mask; 
    int     cxy; 
    LPTSTR  pszText; 
    HBITMAP hbm; 
    int     cchTextMax; 
    int     fmt; 
    LPARAM  lParam; 
#if (_WIN32_IE >= 0x0300)
    int     iImage;
    int     iOrder;
#endif
} HDITEM, FAR * LPHDITEM;

Contains information about an item in a header control. This structure supersedes the HD_ITEM structure.

mask
Flags indicating which other structure members contain valid data or must be filled in. This member can be a combination of the following values:
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
Address of an item string. If this member is set to LPSTR_TEXTCALLBACK, the control will request 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:
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:
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:
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
Version 4.70. 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 field. If iImage is set to I_IMAGECALLBACK, the control requests text information for this item by using an HDN_GETDISPINFO notification message.
iOrder
Version 4.70. 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.

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.


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.