C++ Parent Of A TreeView Item?

a_unique_name 381 Reputation points

Hello Folks:

Developing on Win 11 Pro, Visual Studio 2021 Community, C++, Win32 no MFC.

Given an HTREEITEM, how do I find it's parent's HTREEITEM?



Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,570 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,086 questions
0 comments No comments
{count} votes

1 additional answer

Sort by: Most helpful
  1. uncle_Kei 0 Reputation points

    Use macro in the <commctrl.h>

    HTREEITEM hTreeItemOfParent = TreeView_GetParent( hWndTreeCtrl, hTreeItemChild);

    0 comments No comments