Returns the number of items in the tree control.
C
int WINAPI SftTree_GetCount(HWND hwndCtl); int WINAPI SftTreeSplit_GetCount(HWND hwndCtl);
C++
int CSftTree::GetCount() const; int CSftTreeSplit::GetCount() const;
hwndCtl
The window handle of the tree control.
The return value is the number of items in the tree control.
The GetCount function returns the number of items in the tree control.
// check if header right-clicked - we don't show the context menu there
SftTree_GetHeaderRect(hwndTree, -1, &rect);
if (PtInRect(&rect, pt))
return;
// check if an item cell right-clicked
index = SftTree_CalcIndexFromPointEx(hwndTree, &pt);
if (index >= 0 && index < SftTree_GetCount(hwndTree)) {
// on an item
ShowItemMenu(hwndParent, hwndTree, index, x, y);
return;
}
}
/*------------------------------------------------------------------------------*/
/* This sample code can be used to implement a sorting callback routine. */
// check if header right-clicked - we don't show the popup there
m_Tree.GetHeaderRect(-1, &rect);
if (PtInRect(&rect, ptTree))
return;
// check if an item cell right-clicked
index = m_Tree.CalcIndexFromPointEx(&ptTree);
if (index >= 0 && index < m_Tree.GetCount()) {
// on an item
ShowItemMenu(index, pt);
return;
}
}
void CSampleView::OnSettingChange(UINT uFlags, LPCTSTR lpszSection)
{See Also C/C++ API | Categories | Notifications