Three Tree views

Source: Internet
Author: User
Tvinsertstruct


Contains the information used to add a new item to the Tree View control. This structure is used by tvm_insertitem messages. This structure correspondsTV _insertstructThe structure is the same, but it has been renamed according to the current naming conventions.

 
Typedef struct detail {htreeitem hparent; htreeitem hinsertafter; # If (_ win32_ie> = 0x0400) Union {tvitemex itemex; tvitem item;} dummyunionname; # else tvitem item; # endif} tvinsertstruct, far * lptvinsertstruct;
Member
Hparent
The handle of the parent item. If the value of this Member is tvi_root or null, it will be inserted as the root of the tree control.
Hinsertafter
The handle of the item after the new item is inserted. Or one of the following values:

Value Meaning
Tvi_first Insert items at the beginning of the List
Tvi_last Insert an entry at the end of the list
Tvi_root Add as a root item
Tvi_sort Insert entries in alphabetical order
Itemex
Version 4.71. Tvitemex contains information about the item addition.
Item
Tvitem contains information about the item addition.
Requirement

Windows NT/2000:Windows NT 3.51 or later is required.
Windows 95/98:Windows 95 or later is required.
Header:Defined in commctrl. h.

Tvitem

Specifies or receives the attributes of a tree view. This structure correspondsTV _itemThe structure is the same, but it has been renamed by the current naming protocol. New ApplicationProgramThis structure should be used.

 
Typedef struct tagtvitem {uint mask; htreeitem hitem; uint state; uint statemask; lptstr psztext; int cchtextmax; int iimage; int cursor; int cChildren; lparam;} tvitem, far * lptvitem;
Member
Mask
Identifies the tag arrays containing valid data of other structure members. When this structure is used by tvm_getitem messages, MaskThe Member indicates that the property of the item is retrieved. This member can be one or more of the following values.

Tvif_children CChildrenThe Member is valid.
Tvif_di_setitem The Tree View control retains the supported information and does not request it again. This flag is valid when you process the tvn_getdispinf notification.
Tvif_handle HitemValid members.
Tvif_image IimageValid members.
Tvif_param LparamValid members.
Tvif_selectedimage IselectedimageValid members.
Tvif_state StateAndStatemaskValid members.
Tvif_text PsztextAndCchtextmaxValid members.
Hitem
The item referenced by this function.
State
Position tag and image List Index settings, indicating the item status. When the status of an item is set, StatemaskThe Member States that the bit of this Member is valid. When the status of an item is added, this member returns StatemaskThe current status of the bit pointed by the Member.

The 0 to 7 digits of this member contain the status tag of the item. For more information about possible item status tags, see Tree View Control item states.

Overwrite the image to overwrite the icon image of the item. The 8-11 bits of this Member specify a 1-based covered image index. If these bits are 0, this item does not overwrite the image. To isolate these bits, use the tvis_overlaymask mask. To overwrite the image index in this Member, use the indextooverlaymask macro. The overwritten image in the image list is set by the imagelist_setoverlayimage function.

A status chart is displayed as an icon next only to an item indicating the state defined by the application. Sends a tvm_setimagelist message to specify a list of status images. To set the status image of an itemTvitemStructureStatemaskThe member contains the tvis_stateimagemask value. StructureStateIndex of the image to be drawn in the member's 12-15-bit specified state image list.

To set the status image index, use indextostateimagemask. This macro sets an index to 12 to 15 characters. To specify that the item has no status image, set the index to 0. This means that image 0 in the status image list cannot be used as a status image. To isolateStateUse the tvis_stateimagemask mask.

Statemask
StateThe member bit is valid. If you retrieve the status of an item, Set StatemaskIndicates the position of a Member. StateThe bit in the member is returned. If you set the status of an item, Set StatemaskIndicates the position of a Member. StateThe bit of the member you want to set. To set or retrieve the index of the overwrite image of an item, set the tvis_overlaymask bit. To set and retrieve the status image index of an item, set the tvis_stateimagemask bit.
Psztext
If this structure specifies the item attribute, the member points to a string ending with an empty character and contains the text of the item. If the value of this Member is lpstr_textcallback, the parent window is responsible for saving the name. In this case, when the Tree View control needs to display, save, or edit the item text, it sends a tvn_getdispinfo message to the parent window. When the item text changes, it sends a tvn_setdispinfo notification message.

If the structure is the property of the retrieved item, this member is the address of the retrieved item text buffer.

Cchtextmax
PsztextSpecifies the buffer size, in characters. If this structure is used to set item attributes, this member is ignored.
Iimage
When an item is not selected, it is the index of the image list of the tree control.

If the member is I _imagecallback, the parent window is responsible for saving the index. In this case, when the Tree View control needs to display this image, it sends a tvn_getdispinfo notification message to the parent window for indexing.

Iselectedimage
When an item is selected, it is the index of the tree control image list.

If the member is I _imagecallback, the parent window is responsible for saving the index. In this case, when the Tree View control needs to display this image, it sends a tvn_getdispinfo notification message to the parent window for indexing.

CChildren
Indicates which item has an associated subitem. This member can be one of the following values.

zero This item has no subitem.
one This item has one or more subitems.
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
The 32-bit value related to this parameter.
Yes

Windows NT/2000:Windows NT 3.51 or later is required.
Windows 95/98:Windows 95 or later is required.
Header:Defined in commctrl. h.

Nmtreeview


 

Contains information about tree-based notification messages. This structure correspondsNm_treeviewThe structure is the same, but it has been renamed with the current naming rule.

 
Typedef struct tagnmtreeview {nmhdr HDR; uint action; tvitem itemold; tvitem itemnew; point ptdrag;} nmtreeview, far * lpnmtreeview;
Member
HDR
The nmhdr structure contains information about the notification message.
Action
The action tag specified by the notification.
Itemold
The tvitem structure that contains information about the old item status. When a notification message is not used, the Member is 0.
Itemnew
The tvitem structure that contains new item status information. When a notification message is not used, the Member is 0.
Ptdrag
The point structure that contains the event information that causes the notification message to be sent.
See

Wm_notify

Requirement

Version 4.00Or higher comctl32.dll.

Windows NT/2000:Windows NT 3.51 or later is required.
Windows 95/98:Windows 95 or later is required.
Header:Defined in commctrl. h.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.