TreeView_GetParent macro

Retrieves the parent item of the specified tree-view item. You can use this macro, or you can explicitly send the TVM_GETNEXTITEM message with the TVGN_PARENT flag.

Syntax


HTREEITEM TreeView_GetParent(
   HWND      hwndTV,
   HTREEITEM hitem
);

Parameters

hwndTV

Type: HWND

Handle to the tree-view control.

hitem

Type: HTREEITEM

Handle to an item.

Return value

Returns the handle to the item if successful. For most cases, the message returns a NULL value to indicate an error. See the Remarks section for details

Remarks

This macro will return NULL if the parent of the specified item is the root node of the tree.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Commctrl.h

See also

Reference
TreeView_GetChild
TreeView_GetNextItem
TreeView_GetNextSibling
TreeView_GetPrevSibling

 

 

Show: