The TVM_GETCOUNT message retrieves a count of the items in a tree-view control. You can send this message explicitly or by using the TreeView_GetCount macro.
TVM_GETCOUNT wParam = 0; lParam = 0;
Returns the count of items.
TreeView_GetCount
Comments: