LVCOLUMN Contains information about a column in report view. This structure is used both for creating and manipulating columns. This structure supersedes the LV_COLUMN structure.typedef struct _LVCOLUMN { UINT mask; int fmt; int cx; LPTSTR pszText; int cchTextMax; int iSubItem; #if (_WIN32_IE >= 0x0300) int iImage; int iOrder; #endif } LVCOLUMN, FAR *LPLVCOLUMN; Members mask Variable specifying which members contain valid information. This member can be zero, or one or more of the following values.Value Description LVCF_FMT The fmt member is valid. LVCF_IMAGE Version 4.70. The iImage member is valid. LVCF_ORDER Version 4.70. The iOrder member is valid. LVCF_SUBITEM The iSubItem member is valid. LVCF_TEXT The pszText member is valid. LVCF_WIDTH The cx member is valid. fmt Alignment of the column header and the subitem text in the column. This member can be one of the following values. Value Description LVCFMT_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. LVCFMT_CENTER Text is centered. LVCFMT_COL_HAS_IMAGES Version 4.70. The header item contains an image in the image list. LVCFMT_IMAGE Version 4.70. The item displays an image from an image list. LVCFMT_JUSTIFYMASK A bitmask used to select those bits of fmt that control field justification. To check the format of a column, use a logical "and" to combine LCFMT_JUSTIFYMASK with fmt. You can then use a switch statement to determine whether the LVCFMT_LEFT, LVCFMT_RIGHT, or LVCFMT_CENTER bits are set. LVCFMT_LEFT Text is left-aligned. LVCFMT_RIGHT Text is right-aligned. The alignment of the leftmost column is always left-justified; it cannot be changed.cx Width of the column, in pixels. pszText If column information is being set, this member is the address of a null-terminated string that contains the column header text. If the structure is receiving information about a column, this member specifies the address of the buffer that receives the column header text. cchTextMax Size of the buffer pointed to by the pszText member. If the structure is not receiving information about a column, this member is ignored. iSubItem Index of subitem associated with the column. iImage Version 4.70. Zero-based index of an image within the image list. The specified image will appear within the column. iOrder Version 4.70. Zero-based column offset. Column offset is in left-to-right order. For example, zero indicates the leftmost column. See Also LVM_GETCOLUMN, LVM_SETCOLUMN, LVM_INSERTCOLUMN, LVM_DELETECOLUMNRequirements Windows NT/2000: Requires Windows NT 3.51 or later. Windows 95/98: Requires Windows 95 or later. Header: Declared in commctrl.h.
iOrder: 表示显示时在第几列。
实际的列序和显示的列序可以不同。
LVCOLUMN
Contains information about a column in report view. This structure is used both for creating and manipulating columns. This structure supersedes the LV_COLUMN structure.typedef struct _LVCOLUMN {
UINT mask;
int fmt;
int cx;
LPTSTR pszText;
int cchTextMax;
int iSubItem;
#if (_WIN32_IE >= 0x0300)
int iImage;
int iOrder;
#endif
} LVCOLUMN, FAR *LPLVCOLUMN; Members
mask
Variable specifying which members contain valid information. This member can be zero, or one or more of the following values.Value Description
LVCF_FMT The fmt member is valid.
LVCF_IMAGE Version 4.70. The iImage member is valid.
LVCF_ORDER Version 4.70. The iOrder member is valid.
LVCF_SUBITEM The iSubItem member is valid.
LVCF_TEXT The pszText member is valid.
LVCF_WIDTH The cx member is valid. fmt
Alignment of the column header and the subitem text in the column. This member can be one of the following values. Value Description
LVCFMT_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.
LVCFMT_CENTER Text is centered.
LVCFMT_COL_HAS_IMAGES Version 4.70. The header item contains an image in the image list.
LVCFMT_IMAGE Version 4.70. The item displays an image from an image list.
LVCFMT_JUSTIFYMASK A bitmask used to select those bits of fmt that control field justification. To check the format of a column, use a logical "and" to combine LCFMT_JUSTIFYMASK with fmt. You can then use a switch statement to determine whether the LVCFMT_LEFT, LVCFMT_RIGHT, or LVCFMT_CENTER bits are set.
LVCFMT_LEFT Text is left-aligned.
LVCFMT_RIGHT Text is right-aligned. The alignment of the leftmost column is always left-justified; it cannot be changed.cx
Width of the column, in pixels.
pszText
If column information is being set, this member is the address of a null-terminated string that contains the column header text. If the structure is receiving information about a column, this member specifies the address of the buffer that receives the column header text.
cchTextMax
Size of the buffer pointed to by the pszText member. If the structure is not receiving information about a column, this member is ignored.
iSubItem
Index of subitem associated with the column.
iImage
Version 4.70. Zero-based index of an image within the image list. The specified image will appear within the column.
iOrder
Version 4.70. Zero-based column offset. Column offset is in left-to-right order. For example, zero indicates the leftmost column.
See Also
LVM_GETCOLUMN, LVM_SETCOLUMN, LVM_INSERTCOLUMN, LVM_DELETECOLUMNRequirements
Windows NT/2000: Requires Windows NT 3.51 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in commctrl.h.
iorder 显示时列索引
具体见MSDN
iOrder必须是从0开始依次增加(从左往右),可以通过该值,判断该列位于第几列