
TVN_DELETEITEM
pnmtv = (LPNMTREEVIEW) lParam
Notifies a tree view control's parent window that an item is being deleted. This notification message is sent in the form of a WM_NOTIFY message.
If the lParam member of the TVITEM structure points to memory allocated by your application, you can free it when you receive the TVN_DELETEITEM notification message.
TVN_ENDLABELEDIT
ptvdi = (LPNMTVDISPINFO) lParam
Notifies a tree view control's parent window about the end of label editing for an item. This notification message is sent in the form of a WM_NOTIFY message.
If the pszText member is NULL, the return value is ignored.
If you specified the LPSTR_TEXTCALLBACK value for this item and the pszText member is non-NULL, your TVN_ENDLABELEDIT handler should copy the text from pszText to your local storage.
TVN_GETDISPINFO
lptvdi = (LPNMTVDISPINFO) lParam
Requests that a tree view control's parent window provide information needed to display or sort an item. This notification message is sent in the form of a WM_NOTIFY message.
This notification is sent under the following circumstances:
TVN_GETINFOTIP
lpGetInfoTip = (LPNMTVGETINFOTIP)lParam;
Sent by a tree view control that has the TVS_INFOTIP style. This notification is sent when the control is requesting additional text information to be displayed in a tooltip. The notification is sent in the form of a WM_NOTIFY message.
This notification is only sent by tree view controls that have the TVS_INFOTIP style.
Version 4.71
TVN_ITEMEXPANDED
pnmtv = (LPNMTREEVIEW) lParam
Notifies a tree view control's parent window that a parent item's list of child items has expanded or collapsed. This notification message is sent in the form of a WM_NOTIFY message.
TVN_ITEMEXPANDING
pnmtv = (LPNMTREEVIEW) lParam
Notifies a tree view control's parent window that a parent item's list of child items is about to expand or collapse. This notification message is sent in the form of a WM_NOTIFY message.
TVN_KEYDOWN
ptvkd = (LPNMTVKEYDOWN) lParam
Notifies a tree view control's parent window that the user pressed a key and the tree view control has the input focus. This notification message is sent in the form of a WM_NOTIFY message.
TVN_SELCHANGED
pnmtv = (LPNMTREEVIEW) lParam
Notifies a tree view control's parent window that the selection has changed from one item to another. This notification message is sent in the form of a WM_NOTIFY message.
| TVC_BYKEYBOARD | By a keystroke. |
| TVC_BYMOUSE | By a mouse click. |
| TVC_UNKNOWN | Unknown. |
TVN_SELCHANGING
pnmtv = (LPNMTREEVIEW) lParam
Notifies a tree view control's parent window that the selection is about to change from one item to another. This notification message is sent in the form of a WM_NOTIFY message.
TVN_GETDISPINFO
lptvdi = (LPNMTVDISPINFO) lParam
Notifies a tree view control's parent window that it must update the information it maintains about an item. This notification message is sent in the form of a WM_NOTIFY message.
If the pszText member of the item's TVITEM structure is the LPSTR_TEXTCALLBACK value, the control sends this notification to set the item's text. In this case, the mask member of lptvdi will have the TVIF_TEXT flag set.
TVN_SINGLEEXPAND
lpnmtv = (LPNMTREEVIEW)lParam;
Sent by a tree view control with the TVS_SINGLEEXPAND style when the user opens or closes a tree item using a single click of the mouse. This notification is sent in the form of a WM_NOTIFY message.
This notification is only sent by tree view controls that have the TVS_SINGLEEXPAND style.
Version 4.71
This section contains information about the structures used with tree view controls.
typedef struct tagNMTREEVIEW {
NMHDR hdr;
UINT action;
TVITEM itemOld;
TVITEM itemNew;
POINT ptDrag;
} NMTREEVIEW, FAR *LPNMTREEVIEW;
Contains information about a tree view notification message. This structure is identical to the NM_TREEVIEW structure, but it has been renamed to follow current naming conventions.
See also WM_NOTIFY
typedef struct tagNMTVCUSTOMDRAW {
NMCUSTOMDRAW nmcd;
COLORREF clrText;
COLORREF clrTextBk;
#if (_WIN32_IE >= 0x0400)
int iLevel;
#endif
} NMTVCUSTOMDRAW, *LPNMTVCUSTOMDRAW;
Contains information specific to an NM_CUSTOMDRAW notification message sent by a tree view control.
Version 4.70
typedef struct tagNMTVDISPINFO {
NMHDR hdr;
TVITEM item;
} NMTVDISPINFO, FAR *LPNMTVDISPINFO;
Contains and receives display information for a tree view item. This structure is identical to the TV_DISPINFO structure, but it has been renamed to follow current naming conventions.
| TVIF_CHILDREN | The cChildren member specifies, or is to receive, a value that indicates whether the item has child items. |
| TVIF_IMAGE | The iImage member specifies, or is to receive, the index of the item's nonselected icon in the image list. |
| TVIF_SELECTEDIMAGE | The iSelectedImage member specifies, or is to receive, the index of the item's selected icon in the image list. |
| TVIF_TEXT | The pszText member specifies the new item text or the address of a buffer that is to receive the item text.
If the structure is receiving item text, you typically copy the text to the buffer pointed to by the pszText member of the TVITEM structure. However, you can return a string in the pszText member instead. If you do so, you cannot change or delete the string until the corresponding item text is deleted or until two additional TVN_GETDISPINFO notification messages have been sent. |
See also TVN_SETDISPINFO, WM_NOTIFY
typedef struct tagNMTVGETINFOTIP {
NMHDR hdr;
LPTSTR pszText;
int cchTextMax;
HTREEITEM hItem;
LPARAM lParam;
} NMTVGETINFOTIP, *LPNMTVGETINFOTIP;
Contains and receives tree view item information needed to display a tooltip for an item. This structure is used with the TVN_GETINFOTIP notification message.
typedef struct tagTVKEYDOWN {
NMHDR hdr;
WORD wVKey;
UINT flags;
} NMTVKEYDOWN, FAR *LPNMTVKEYDOWN;
Contains information about a keyboard event in a tree view control. This structure is used with the TVN_KEYDOWN notification message. The structure is identical to the TV_KEYDOWN structure, but it has been renamed to follow current naming conventions.
See also WM_NOTIFY
typedef struct tagTVHITTESTINFO {
POINT pt;
UINT flags;
HTREEITEM hItem;
} TVHITTESTINFO, FAR *LPTVHITTESTINFO;
Contains information used to determine the location of a point relative to a tree view control. This structure is used with the TVM_HITTEST message. The structure is identical to the TV_HITTESTINFO structure, but it has been renamed to follow current naming conventions.
| TVHT_ABOVE | Above the client area. |
| TVHT_BELOW | Below the client area. |
| TVHT_NOWHERE | In the client area, but below the last item. |
| TVHT_ONITEM | On the bitmap or label associated with an item. |
| TVHT_ONITEMBUTTON | On the button associated with an item. |
| TVHT_ONITEMICON | On the bitmap associated with an item. |
| TVHT_ONITEMINDENT | In the indentation associated with an item. |
| TVHT_ONITEMLABEL | On the label (string) associated with an item. |
| TVHT_ONITEMRIGHT | In the area to the right of an item. |
| TVHT_ONITEMSTATEICON | On the state icon for a tree view item that is in a user-defined state. |
| TVHT_TOLEFT | To the left of the client area. |
| TVHT_TORIGHT | To the right of the client area. |
typedef struct tagTVINSERTSTRUCT {
HTREEITEM hParent;
HTREEITEM hInsertAfter;
#if (_WIN32_IE >= 0x0400)
union
{
TVITEMEX itemex;
TVITEM item;
} DUMMYUNIONNAME;
#else
TVITEM item;
#endif
} TVINSERTSTRUCT, FAR *LPTVINSERTSTRUCT;
Contains information used to add a new item to a tree view control. This structure is used with the TVM_INSERTITEM message. The structure is identical to the TV_INSERTSTRUCT structure, but it has been renamed to follow current naming conventions.
| TVI_FIRST | Inserts the item at the beginning of the list. |
| TVI_LAST | Inserts the item at the end of the list. |
| TVI_SORT | Inserts the item into the list in alphabetical order. |
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.
| 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. |
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.
| 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. |
typedef struct tagTVITEMEX{
UINT mask;
HTREEITEM hItem;
UINT state;
UINT stateMask;
LPTSTR pszText;
int cchTextMax;
int iImage;
int iSelectedImage;
int cChildren;
LPARAM lParam;
int iIntegral;
} TVITEMEX, FAR *LPTVITEMEX;
Specifies or receives attributes of a tree view item. This structure is an enhancement to the TVITEM structure. New applications should use this structure where appropriate.
| TVIF_CHILDREN | The cChildren member is valid. |
| TVIF_HANDLE | The hItem member is valid. |
| TVIF_IMAGE | The iImage member is valid. |
| TVIF_INTEGRAL | The iIntegral 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. |
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, 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.
| 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. |
Version 4.71
typedef struct tagTVSORTCB{
HTREEITEM hParent;
PFNTVCOMPARE lpfnCompare;
LPARAM lParam;
} TVSORTCB, FAR *LPTVSORTCB;
Contains information used to sort child items in a tree view control. This structure is used with the TVM_SORTCHILDRENCB message. This structure is identical to the TV_SORTCB structure, but it has been renamed to follow current naming conventions.
int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
The lParam1 and lParam2 parameters correspond to the lParam member of the TVITEM structure for the two items being compared. The lParamSort parameter corresponds to the lParam member of this structure.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.