MFC中list列表标头的问题
答案:1 悬赏:20 手机版
解决时间 2021-03-27 11:59
- 提问者网友:做自己de王妃
- 2021-03-26 14:11
MFC中list列表标头的问题
最佳答案
- 五星知识达人网友:风格不统一
- 2021-03-26 14:30
HDITEM
Contains information about an item in a header control. This structure supersedes the HD_ITEM structure.
HDITEM是M$定义的结构体类型 用来描述 header control
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;
LPVOID pvFilter;
#endif
} HDITEM, FAR * LPHDITEM;
Members
mask ---------- 结构体成员mask 由以下几个bit信息(位运算学过没? 你的那是 “按位或”)最合起来
Flags indicating which other structure members contain valid data or must be filled in. This member can be a combination of the following values: Flag Description
HDI_BITMAP The hbm member is valid.
HDI_FORMAT The fmt member is valid. ========fmt成员有效
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 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.
=====iImage成员有效
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.
CHeaderCtrl::GetItem
BOOL GetItem( int nPos, HDITEM* pHeaderItem ) const; // 指针没学过么
pHeader->GetItem(m_ncol,&hdi); 取变量的地址没学过么
C基础语法之指针做函数的参数,实测是某个变量的地址 形参是指针变量,
fmt
Flags that specify the item's format. -------- 用来制定item的格式
Set one of the following flags to specify text justification:
Flag Description
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. 右对齐
Set one of the following flags to control the display:
Flag Description
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_OWNERDRAW The header control's owner draws the item.
HDF_STRING The item displays a string.
The preceding value can be combined with:
Flag Description
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 display 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 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.追问恩,以上非常感谢。另还有个疑问 HDITEM hdi={HDI_IMAGE|HDI_FORMAT}; 其中HDI_IMAGE|HDI_FORMAT这两个成员进行或运算作用是什么?
Contains information about an item in a header control. This structure supersedes the HD_ITEM structure.
HDITEM是M$定义的结构体类型 用来描述 header control
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;
LPVOID pvFilter;
#endif
} HDITEM, FAR * LPHDITEM;
Members
mask ---------- 结构体成员mask 由以下几个bit信息(位运算学过没? 你的那是 “按位或”)最合起来
Flags indicating which other structure members contain valid data or must be filled in. This member can be a combination of the following values: Flag Description
HDI_BITMAP The hbm member is valid.
HDI_FORMAT The fmt member is valid. ========fmt成员有效
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 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.
=====iImage成员有效
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.
CHeaderCtrl::GetItem
BOOL GetItem( int nPos, HDITEM* pHeaderItem ) const; // 指针没学过么
pHeader->GetItem(m_ncol,&hdi); 取变量的地址没学过么
C基础语法之指针做函数的参数,实测是某个变量的地址 形参是指针变量,
fmt
Flags that specify the item's format. -------- 用来制定item的格式
Set one of the following flags to specify text justification:
Flag Description
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. 右对齐
Set one of the following flags to control the display:
Flag Description
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_OWNERDRAW The header control's owner draws the item.
HDF_STRING The item displays a string.
The preceding value can be combined with:
Flag Description
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 display 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 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.追问恩,以上非常感谢。另还有个疑问 HDITEM hdi={HDI_IMAGE|HDI_FORMAT}; 其中HDI_IMAGE|HDI_FORMAT这两个成员进行或运算作用是什么?
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯