HDITEMW structure (commctrl.h)
Contains information about an item in a header control. This structure supersedes the HD_ITEM structure.
Syntax
typedef struct _HD_ITEMW {
UINT mask;
int cxy;
LPWSTR pszText;
HBITMAP hbm;
int cchTextMax;
int fmt;
LPARAM lParam;
int iImage;
int iOrder;
UINT type;
void *pvFilter;
UINT state;
} HDITEMW, *LPHDITEMW;
Members
mask
Type: UINT
Flags indicating which other structure members contain valid data or must be filled in. This member can be a combination of the following values:
Value | Meaning |
---|---|
|
The hbm member is valid. |
|
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.) |
|
The fmt member is valid. |
|
The type and pvFilter members are valid. This is used to filter out the values specified in the type member. |
|
The same as HDI_WIDTH. |
|
The iImage member is valid and specifies the image to be displayed with the item. |
|
The lParam member is valid. |
|
The iOrder member is valid and specifies the item's order value. |
|
Version 6.00 and later. The state member is valid. |
|
The pszText and cchTextMax members are valid. |
|
The cxy member is valid and specifies the item's width. |
cxy
Type: int
The width or height of the item.
pszText
Type: LPTSTR
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 code. 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
Type: HBITMAP
A handle to the item bitmap.
cchTextMax
Type: int
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
Type: int
Flags that specify the item's format.
Value | Meaning |
---|---|
|
Set one of the following flags to specify text justification: |
|
The item's contents are centered. |
|
The item's contents are left-aligned. |
|
The item's contents are right-aligned. |
|
Set one of the following flags to control the display: |
|
The item displays a bitmap. |
|
The bitmap appears to the right of text. |
|
The header control's owner draws the item. |
|
The item displays a string. |
|
The preceding value can be combined with: |
|
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. |
|
Isolate the bits corresponding to the three justification flags listed in the preceding table. |
|
Typically, windows displays text left-to-right (LTR). 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. |
|
Version 6.00 and later. 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. |
|
Version 6.00 and later. 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. |
|
Version 6.00 and later. The item displays a checkbox. The flag is only valid when the HDS_CHECKBOXES style is first set on the header control. |
|
Version 6.00 and later. The item displays a checked checkbox. The flag is only valid when HDF_CHECKBOX is also set. |
|
Version 6.00 and later. The width of the item cannot be modified by a user action to resize it. |
|
Version 6.00 and later. The item displays a split button. The HDN_DROPDOWN notification is sent when the split button is clicked. |
lParam
Type: LPARAM
Application-defined item data.
iImage
Type: int
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 code. To clear the image, set this value to I_IMAGENONE.
iOrder
Type: int
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
Type: UINT
The type of filter specified by pvFilter. The possible types include:
Value | Meaning |
---|---|
|
String data. |
|
Numerical data. |
|
Ignore pvFilter. |
|
Version 6.00 and later. Date data. The pvFilter member is a pointer to a SYSTEMTIME structure. |
pvFilter
Type: void*
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
Type: UINT
The state. The only valid, supported value for this member is the following:
Value | Meaning |
---|---|
|
The item has keyboard focus. |
Remarks
Note
The commctrl.h header defines HDITEM as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Header | commctrl.h |