Call this function to retrieve the bounding rectangle for hItem and determine whether it is visible or not.
The handle of a tree view control item.
Pointer to a RECT structure that receives the bounding rectangle. The coordinates are relative to the upper-left corner of the tree view control.
If this parameter is nonzero, the bounding rectangle includes only the text of the item. Otherwise it includes the entire line that the item occupies in the tree view control.
Nonzero if the item is visible, with the bounding rectangle contained in lpRect. Otherwise, 0 with lpRect uninitialized.
HTREEITEM hmyItem = m_TreeCtrl.GetSelectedItem();
// Dump the bounds of hmyItem.
if (hmyItem != NULL)
m_TreeCtrl.GetItemRect(hmyItem, &r, FALSE);
TRACE(TEXT("left = %d, top = %d, right = %d, bottom = %d\r\n"),