Three structures of tree

zhaozj2021-02-08  241

TVinsertstruct

Contains information to add new items to the tree view control. This structure is used by the TVM_INSERTITEM message. This structure is the same as the TV_INSERTSTRUCT structure, but it has been renamed in current naming habits.

Typedef struct tagtvinsertstruct {

HtreeItem hParent;

HtreeItem HinsetAfter;

#if (_WIN32_IE> = 0x0400)

union

{

TViteMex ITEMEX;

TVitem item;

} DummyunionName;

#ELSE

TVitem item;

#ENDIF

} TVINSERTSTRUCT, FAR * LPTVINSERTSTRUCT;

member

Hparent

The handle of the parent. If the value of this member is TVi_root or NULL, this will be inserted as the root of the tree control.

HinsetAfter

The handle of the item after the new item being inserted. Or one of the following values:

Value means TVi_first on the list of start plug-in TVi_last in the list of last insert TVi_root to add TVI_Sort as an root item insertion item

ITEMEX

version

4.71.

TViteMex contains information about item added.

Item

TVItem contains information about item added.

demand

Windows NT / 2000: Requires Windows NT 3.51 or higher. Windows 95/98: Need Windows 95 or higher. Header: Defines in CommCtrl.h.

TVItem

Specify or receive the properties of the tree viewing. This structure is the same as the TV_item structure, but it has been renamed by the current naming protocol. This structure should be used in new applications.

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;

member

Mask

It is pointed out that other structural members contain a marker array of valid data. When this structure is

Tvm_getitym message is used,

Mask members indicate that the properties of the item are retrieved. This member can be one or more of the following values.

Tvif_childrencchildren members are valid. TVIF_DI_SETITEM tree view control will retain support information and do not reclaim it. This tag is effective when the TVN_GetDispinf is handled. Tvif_Handlehitem is valid. TVIF_IMAGEIIMAGE members are valid. Tvif_ParamlParam members are valid. TVIF_SELECTEDIMAGEISELECTEDIMAGE members are valid. Tvif_stateState and Statemask members are valid. TVIF_TextpszText and CCHTextMax members are valid.

Hitem

This function is referenced.

State

The setting of bit tag and image list index indicates the status of the item. When set a state,

STATEMASK members pointed out that the bits of this member are valid. This member returns when taking an item.

The current state of the bitmask member pointed out.

The 0 to 7 bits of this member contain the status tag of the item. See Tree View Control Item State for possible item status tags.

The overlay image is overwritten above the icon image of the item. The 8 to 11 bits of this member specify an overlay image index of 1-based. If these bits are 0, this item does not overwrite the image. To isolate these bits, use the TVIS_OVERLAYMASK mask. To set over this member, you have to override the image index, use the Indextooverlaymask macro. The overlay image of the image list is set by the ImageList_setoverlayImage function. A status image is displayed only for items that indicate the state of the application defined. Specify a status image list by sending a TVM_setImageList message. To set the status image of an item, contain the TVIS_StateImageMask value in the StateMask member of the TVItem structure. The 12 to 15 bits of the STATE member of the structure specifies the index of the image in the status image list.

To set the status image index, use IndextOstateImageMask. This macro sets an index to 12 to 15 digits. To point out that there is no status image, set the index of 0. This means that the image 0 in the status image list cannot be used as a state image. To isolate the bits 12 to 15 of the State member, use the TVS_StateImageMask mask.

STATEMASK

The bit member of the State member is effective. If you retrieve a status, set

The bitmask member of Statemask pointed out

This bit in the State member is returned. If you set a status, set

The bitmask member of Statemask pointed out

This bit of State member is what you want to set. To set or retrieve an index of an overlay image, set the TV_overlaymask bit. To set up and retrieve the status image index of an item, set the TVS_StateImageMask bit.

PSZText

If this structure specifies item properties, this member is a string that ends with empty characters, contains text. If this member is a value lpstr_textCallback, the parent window is responsible for saving the name. In this case, send the parent window when the tree view control needs to be displayed, saved or edited.

TVN_GetDispinfo sent by the message, when the item text changes

TVN_SETDISPINFO notification message.

If the structure is an attribute that is retrieved, this member is the address of the item buffer.

Cchtextmax

PSZText member specifies the size of the buffer to character in characters. If this structure is used to set item properties, this member is ignored.

IImage

When the item is in a non-selected state, it is an index of the image list of the tree control.

If this member is a value I_ImageCallback, the parent window is responsible for saving the index. In this case, when the tree view control needs to display this image, send a TVN_GETDISPINFO notification message to the parent window to obtain an index.

IselectedImage

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

If this member is a value I_ImageCallback, the parent window is responsible for saving the index. In this case, when the tree view control needs to display this image, send a TVN_GETDISPINFO notification message to the parent window to obtain an index.

CChildren

The tag indicates which item has the associated child. This member can be one of the following values.

ZERO does not have a child. One is one or more children. I_CHILDRENCALLBACKThe 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 control1mory usage by inserting child items only when the item is visible or expressed.lparam

With this related 32-bit value.

need

Windows NT / 2000: Requires Windows NT 3.51 or higher. Windows 95/98: Need Windows 95 or higher. Header: Defines in CommCtrl.h.

NMTreeView

Contains information about the tree view notification message. This structure is the same as the NM_TreeView structure, but it has renamed with the current naming rules.

Typedef struct tagnmtreeview {

NMHDR HDR;

Uint Action;

TVitem item.

TVitem itemnew;

Point PTDRAG;

NMTREEVIEW, FAR * LPNMTREEVIEW;

member

HDR

NMHDR structure contains information about this notification message

Action

Notify the specified action mark.

Itemold

Contains information about the old item status

TVitem structure. When the notification message is not used, this member is 0.

Itemnew

Contains information about new item information

TVitem structure. When the notification message is not used, this member is 0.

PTDRAG

Contains event information that causes notification messages

Point structure.

See

WM_NOTIFY

demand

4.00 version or higher COMCTL32.DLL.

Windows NT / 2000: Requires Windows NT 3.51 or higher. Windows 95/98: Need Windows 95 or higher. Header: Defines in CommCtrl.h.

转载请注明原文地址:https://www.9cbs.com/read-3431.html

New Post(0)