From MSDN:TVM_EXPAND The TVM_EXPAND message expands or collapses the list of child items associated with the specified parent item, if any. You can send this message explicitly or by using the TreeView_Expand macro. TVM_EXPAND wParam = (WPARAM) (UINT) flag; lParam = (LPARAM) (HTREEITEM) hItem; Parameters flag Action flag. This parameter can be one or more of the following values: TVE_COLLAPSE Collapses the list. TVE_COLLAPSERESET Collapses the list and removes the child items. The TVIS_EXPANDEDONCE state flag is reset. This flag must be used with the TVE_COLLAPSE flag. TVE_EXPAND Expands the list. TVE_EXPANDPARTIAL Version 4.70. Partially expands the list. In this state the child items are visible and the parent item's plus sign (+), indicating that it can be expanded, is displayed. This flag must be used in combination with the TVE_EXPAND flag. TVE_TOGGLE Collapses the list if it is expanded or expands it if it is collapsed. hItem Handle to the parent item to expand or collapse. Return Values Returns nonzero if the operation was successful, or zero otherwise.Res Expanding a node that is already expanded, or collapsing a node that is already collapsed is considered a successful operation and TVM_EXPAND will return a non-zero value. Attempting to expand or collapse a node that has no children is considered a failure and TVM_EXPAND will return zero.When an item is first expanded , a TVM_EXPAND message generates TVN_ITEMEXPANDING and TVN_ITEMEXPANDED notification messages and the item's TVIS_EXPANDEDONCE state flag is set. As long as this state flag remains set, subsequent TVM_EXPAND messages will not generate TVN_ITEMEXPANDING or TVN_ITEMEXPANDED notifications. To reset the TVIS_EXPANDEDONCE state flag, you must send a TVM_EXPAND message with the TVE_COLLAPSE and TVE_COLLAPSERESET flags set. Attempting to explicitly set TVIS_EXPANDEDONCE will result in unpredictable behavior.The expand operation may fail if the owner of the treeview control denies the operation in response to a TVN_ITEMEXPANDING notification
The TVM_EXPAND message expands or collapses the list of child items associated with the specified parent item, if any. You can send this message explicitly or by using the TreeView_Expand macro. TVM_EXPAND
wParam = (WPARAM) (UINT) flag;
lParam = (LPARAM) (HTREEITEM) hItem; Parameters
flag
Action flag. This parameter can be one or more of the following values: TVE_COLLAPSE Collapses the list.
TVE_COLLAPSERESET Collapses the list and removes the child items. The TVIS_EXPANDEDONCE state flag is reset. This flag must be used with the TVE_COLLAPSE flag.
TVE_EXPAND Expands the list.
TVE_EXPANDPARTIAL Version 4.70. Partially expands the list. In this state the child items are visible and the parent item's plus sign (+), indicating that it can be expanded, is displayed. This flag must be used in combination with the TVE_EXPAND flag.
TVE_TOGGLE Collapses the list if it is expanded or expands it if it is collapsed. hItem
Handle to the parent item to expand or collapse.
Return Values
Returns nonzero if the operation was successful, or zero otherwise.Res
Expanding a node that is already expanded, or collapsing a node that is already collapsed is considered a successful operation and TVM_EXPAND will return a non-zero value. Attempting to expand or collapse a node that has no children is considered a failure and TVM_EXPAND will return zero.When an item is first expanded , a TVM_EXPAND message generates TVN_ITEMEXPANDING and TVN_ITEMEXPANDED notification messages and the item's TVIS_EXPANDEDONCE state flag is set. As long as this state flag remains set, subsequent TVM_EXPAND messages will not generate TVN_ITEMEXPANDING or TVN_ITEMEXPANDED notifications. To reset the TVIS_EXPANDEDONCE state flag, you must send a TVM_EXPAND message with the TVE_COLLAPSE and TVE_COLLAPSERESET flags set. Attempting to explicitly set TVIS_EXPANDEDONCE will result in unpredictable behavior.The expand operation may fail if the owner of the treeview control denies the operation in response to a TVN_ITEMEXPANDING notification