CPropTreeItem* CPropTree::FindItem(const POINT& pt) { CPropTreeItem* pItem; CPoint p = pt; // convert screen to tree coordinates p.y += m_Origin.y; // search the visible list for the item for (pItem = m_pVisbleList; pItem; pItem = pItem->GetNextVisible()) { CPoint ipt = pItem->GetLocation(); if (p.y>=ipt.y && p.y<ipt.y + pItem->GetHeight()) return pItem; } return NULL; }