HDITEM

This structure contains information about an item in a header control. This structure has been updated to support header item images and order values.

typedef struct _HDITEM {
UINT mask; 
int cxy; 
LPTSTR pszText; 
HBITMAP hbm; 
int cchTextMax; 
int fmt; 
LPARAM lParam; 
int iImage;
int iOrder;} 
HDITEM;

Members

  • mask
    Specifies 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 items height.
    HDI_IMAGE The iImage member is valid and specifies the image to be displayed with the item.
    HDI_LPARAM The lParam member is valid.
    HDI_ORDER The iOrder member is valid and specifies the items order value.
    HDI_TEXT The pszText and cchTextMax members are valid.
    HDI_WIDTH The cxy member is valid and specifies the items 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 will request text information for this item by using HDN_GETDISPINFO notification messages.

  • hbm
    Handle to the item bitmap.

  • cchTextMax
    Length of the item string, in characters.

  • fmt
    Set of bit flags that specify the items format.

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

    Value Description
    HDF_CENTER The items contents are centered.
    HDF_LEFT The items contents are left-aligned.
    HDF_RIGHT The items contents are right-aligned.

    The preceding flag is combined with one of the following flags.

    Value Description
    HDF_BITMAP The item displays a bitmap.
    HDF_BITMAP_ON_RIGHT The bitmap appears to the right of text. This does not affect an image from an image list assigned to the header item.
    HDF_OWNERDRAW The header controls 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 HDN_GETDISPINFO notification messages.

  • 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.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.0 and later Commctrl.h    

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

HDN_GETDISPINFO

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.