关于 VC的 TVINSETSTRUCT结构的问题?(祝国家繁荣富强)

rfa20 2000-03-19 10:18:00
各位高手

<<VC技术内幕>> 第四版page 123, 关于TVINSETSTRUCT的设置:

TVINSETSTRUCT t,
t.item.hItem=NULL;
t.item.state=0;
t.item.stateMask=0;
t.item.CChTextMax=6;

我在MSDN中找到了它的介绍,但找不到关于(TVITEM )item的成员变量
(hItem 、state 、stateMask 、CChTextMax)的附值(如上代码)
的介绍。怎么办?

关于它的附值叙述在那能找到?

今后,我想学关于网络及数据库的编程,winsock,com,ActiveX,他们的重要性如何?
学习得顺序如何?学VC一定要学win32编程吗?
谢谢您的指教
祝国家繁荣富强,早日统一台湾

也祝大家身体健康,天天顺心
...全文
126 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
sunsetyang 2000-03-19
  • 打赏
  • 举报
回复
stateMask按照MSDN中的说明是指定state中那些位是有效的.0是说明任何state的信息都是无效的.而CChTextMax是pszText指针所指向的缓冲区大小.
ren20 2000-03-19
  • 打赏
  • 举报
回复
我是问题的作者:

我的MSDN里也有,我是想问:

t.item.stateMask=0;
t.item.CChTextMax=6;

中 0 , 6 的各代表什么含义?
Un1 2000-03-19
  • 打赏
  • 举报
回复
我的MSDN中有TVITEM呀?!TVITEM


typedef struct tagTVITEM{
UINT mask;
HTREEITEM hItem;
UINT state;
UINT stateMask;
LPTSTR pszText;
int cchTextMax;
int iImage;
int iSelectedImage;
int cChildren;
LPARAM lParam;
} TVITEM, FAR *LPTVITEM;

Specifies or receives attributes of a tree view item. This structure is identical to the TV_ITEM structure, but it has been renamed to follow current naming conventions. New applications should use this structure.

mask
Array of flags that indicate which of the other structure members contain valid data. When this structure is used with the TVM_GETITEM message, the mask member indicates the item attributes to retrieve. This member can be one or more of the following values: TVIF_CHILDREN The cChildren member is valid.
TVIF_HANDLE The hItem member is valid.
TVIF_IMAGE The iImage member is valid.
TVIF_PARAM The lParam member is valid.
TVIF_SELECTEDIMAGE The iSelectedImage member is valid.
TVIF_STATE The state and stateMask members are valid.
TVIF_TEXT The pszText and cchTextMax members are valid.

hItem
Identifies the item to which this structure refers.
state
A set of bit flags and image list indexes that indicate the item's state. When setting the state of an item, the stateMask member indicates the bits of this member that are valid. When retrieving the state of an item, this member returns the current state for the bits indicated in the stateMask member.
Bits 0 through 7 of this member contain the item state flags. For a list of possible item state flags, see Tree View Control Item States.

Bits 8 through 11 of this member specify the one-based overlay image index. The overlay image is superimposed over the item's icon image. If these bits are zero, the item has no overlay image. To isolate these bits, use the TVIS_OVERLAYMASK mask. To set the overlay image index in this member, you should use the INDEXTOOVERLAYMASK macro. The image list's overlay images are set with the ImageList_SetOverlayImage function.

Bits 12 through 15 of this member specify the state image index. The state image is displayed next to an item's icon to indicate an application-defined state. If these bits are zero, the item has no state image. To isolate these bits, use the TVIS_STATEIMAGEMASK mask. To set the state image index, you should use the INDEXTOSTATEIMAGEMASK macro. The state image index specifies the index of the image in the state image list that should be drawn. The state image list is specified with the TVM_SETIMAGELIST message.

stateMask
Bits of the state member that are valid. If you are retrieving an item's state, set the bits of the stateMask member to indicate the bits to be returned in the state member. If you are setting an item's state, set the bits of the stateMask member to indicate the bits of the state member that you want to set. To set or retrieve an item's overlay image index, set the TVIS_OVERLAYMASK bits. To set or retrieve an item's state image index, set the TVIS_STATEIMAGEMASK bits.
pszText
Address of a null-terminated string that contains the item text if the structure specifies item attributes. If this member is the LPSTR_TEXTCALLBACK value, the parent window is responsible for storing the name. In this case, the tree view control sends the parent window a TVN_GETDISPINFO notification message when it needs the item text for displaying, sorting, or editing and a TVN_SETDISPINFO notification message when the item text changes.
If the structure is receiving item attributes, this member is the address of the buffer that receives the item text.
cchTextMax
Size of the buffer pointed to by the pszText member, in characters. If this structure is being used to set item attributes, this member is ignored.
iImage
Index in the tree view control's image list of the icon image to use when the item is in the nonselected state.
If this member is the I_IMAGECALLBACK value, the parent window is responsible for storing the index. In this case, the tree view control sends the parent a TVN_GETDISPINFO notification message to get the index when it needs to display the image.
iSelectedImage
Index in the tree view control's image list of the icon image to use when the item is in the selected state.
If this member is the I_IMAGECALLBACK value, the parent window is responsible for storing the index. In this case, the tree view control sends the parent a TVN_GETDISPINFO notification message to get the index when it needs to display the image.
cChildren
Flag that indicates whether the item has associated child items. This member can be one of the following values: zero The item has no child items.
one The item has one or more child items.
I_CHILDRENCALLBACK The parent window keeps track of whether the item has child items. In this case, when the tree view control needs to display the item, the control sends the parent a TVN_GETDISPINFO notification message to determine whether the item has child items.
If the tree view control has the TVS_HASBUTTONS style, it uses this member to determine whether to display the button indicating the presence of child items. You can use this member to force the control to display the button even though the item does not have any child items inserted. This allows you to display the button while minimizing the control's memory usage by inserting child items only when the item is visible or expanded.

lParam
A 32-bit value to associate with the item.

--------------------------------------------------------------------------------


16,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧