The user can directly edit the labels of items in a tree view control that has the TVS_EDITLABELS style. The user begins editing by clicking the label of the item that has the focus. An application begins editing by using the TVM_EDITLABEL message. The tree view control notifies the parent window when editing begins and when it is canceled or completed. When the user or application completes editing, the parent window is responsible for updating the item's label, if appropriate.
When the user begins editing the label, a tree view control sends its parent window a TVN_BEGINLABELEDIT notification message. By processing this notification, an application can allow editing of some labels and prevent editing of others. Returning zero allows editing, and returning nonzero prevents it.
When the user cancels or completes editing the label, a tree view control sends its parent window a TVN_ENDLABELEDIT notification message. The pszText member of TVITEM is zero if editing is canceled.