'treeview clear delete items
'   从树视图中删除所有项目。
'   hWndControl: 控件的句柄 (例如  HWND_FORM1_TREEVIEW1)   
'   Returns:     如果成功返回 %TRUE 否则为 %FALSE 
Function FF_TreeView_DeleteAllItems (ByVal hWndControl as HWnd) as Long

    '检查窗口句柄是否有效
    If IsWindow(hWndControl) Then  
       ' Remove all items starting at the root of the TreeView.
       Function = SendMessage( hWndControl, TVM_DELETEITEM, 0, Cast(LPARAM, TVI_ROOT))
    End If  

End Function

