HDITEM Structure

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

Syntax

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
#if (_WIN32_IE >= 0x0500)
    UINT    type;
    void    *pvFilter;
#endif
#if _WIN32_WINNT >= 0x0600
    UINT   state;
#endif
} HDITEM,  *LPHDITEM;

Members

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_DI_SETITEM
Version 4.70. While handling the message HDM_GETITEM, the header control may not have all the values needed to complete the request. In this case, the control must call the application back for the values via the HDN_GETDISPINFO notification. If HDI_DI_SETITEM has been passed in the HDM_GETITEM message, the control will cache any values returned from HDN_GETDISPINFO (otherwise the values remain unset.)
HDI_FORMAT
The fmt member is valid.
HDI_FILTER
Version 5.80. The type and pvFilter members are valid. This is used to filter out the values specified in the type member.
HDI_HEIGHT
The same as HDI_WIDTH.
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_STATE
Version 6.00 and Windows Vista. The state member is valid.
HDI_TEXT
The pszText and cchTextMax members are valid.
HDI_WIDTH
The cxy member is valid and specifies the item's width.
cxy
The width or height of the item.
pszText
A pointer to an item string. If the text is being retrieved from the control, this member must be initialized to point to a character buffer. If this member is set to LPSTR_TEXTCALLBACK, the control will request text information for this item by sending an HDN_GETDISPINFO notification message. Note that although the header control allows a string of any length to be stored as item text, only the first 260 TCHARs are displayed.
hbm
A handle to the item bitmap.
cchTextMax
The length of the item string, in TCHARs. If the text is being retrieved from the control, this member must contain the number of TCHARs at the address specified by pszText.
fmt
Flags that specify the item's format.

Text Justification:
Set one of the following flags to specify text justification:
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.

Display:
Set one of the following flags to control the display:
HDF_BITMAP
The item displays a bitmap.
HDF_BITMAP_ON_RIGHT
Version 4.70. The bitmap appears to the right of text.
HDF_OWNERDRAW
The header control's owner draws the item.
HDF_STRING
The item displays a string.

Combining Flags:
The preceding value can be combined with:
HDF_IMAGE
Version 4.70. Display an image from an image list. Specify the image list by sending an HDM_SETIMAGELIST message. Specify the index of the image in the iImage member of this structure.
HDF_JUSTIFYMASK
Isolate the bits corresponding to the three justification flags listed in the preceding table.
HDF_RTLREADING
Typically, windows displays text left-to-right (LTR). Microsoft Windows can be mirrored to display languages such as Hebrew or Arabic that read right-to-left (RTL). Usually, header text is read in the same direction as the text in its parent window. If HDF_RTLREADING is set, header text will read in the opposite direction from the text in the parent window.
HDF_SORTDOWN
Version 6.00. Draws a down-arrow on this item. This is typically used to indicate that information in the current window is sorted on this column in descending order. This flag cannot be combined with HDF_IMAGE or HDF_BITMAP.
HDF_SORTUP
Version 6.00. Draws an up-arrow on this item. This is typically used to indicate that information in the current window is sorted on this column in ascending order. This flag cannot be combined with HDF_IMAGE or HDF_BITMAP.
HDF_CHECKBOX
Microsoft Windows Vista and Version 6.00. The item displays a checkbox. The flag is only valid when the HDS_CHECKBOXES style is first set on the header control.
HDF_CHECKED
Microsoft Windows Vista and Version 6.00. The item displays a checked checkbox. The flag is only valid when HDF_CHECKBOX is also set.
HDF_FIXEDWIDTH
Microsoft Windows Vista and Version 6.00.The width of the item cannot be modified by a user action to resize it.
HDF_FOCUSED
Microsoft Windows Vista and Version 6.00. The item has keyboard focus.
HDF_SPLITBUTTON
Microsoft Windows Vista and Version 6.00. The item displays a split button. The HDN_DROPDOWN notification is sent when the split button is clicked.
lParam
Application-defined item data.
iImage
Version 4.70. The 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. To clear the image, set this value to I_IMAGENONE.
iOrder
Version 4.70. The 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.
type
Version 5.80. The type of filter specified by pvFilter. The possible types include:
HDFT_ISSTRING
String data.
HDFT_ISNUMBER
Numerical data.
HDFT_HASNOVALUE
Ignore pvFilter.
HDFT_ISDATE
SYSTEMTIME.
pvFilter
Version 5.80. The address of an application-defined data item. The data filter type is determined by setting the flag value of the member. Use the HDFT_ISSTRING flag to indicate a string and HDFT_ISNUMBER to indicate an integer. When the HDFT_ISSTRING flag is used pvFilter is a pointer to a HDTEXTFILTER structure.
state
The state. The only valid, supported value for this member is the following:
HDIS_FOCUSED
The item has keyboard focus.

Remarks

Note  Comctl32.dll version 6 is not redistributable but it is included in Windows XP and later. To use Comctl32.dll version 6, specify it in a manifest. For more information on manifests, see Enabling Visual Styles.

Structure Information

Headercommctrl.h
Minimum operating systems Windows NT 3.51, Windows 95
Tags :


Community Content

XenonOfArcticus
HDF_SPLITBUTTON is Vista-only
While this document says HDF_SPLITBUTTON is "Microsoft Windows Vista and Version 6.00", other references disagree:
http://msdn.microsoft.com/en-us/magazine/cc163384.aspx
http://msdn.microsoft.com/en-us/library/bb775339(VS.85).aspx
both imply that SplitButton is VIsta-only, not 6.00 (XP).

The same seems true for HDF_CHECKBOX, HDF_CHECKED, HDF_FIXEDWIDTH and HDF_FOCUSED, which do not appear in the XP SDK commctrl.h.
Tags : contentbug

Page view tracker