Renaming Tree Nodes
-
I have used PreTranslate message to capture the renaming of Tree Nodes. I am capturing the VK_RETURN key to complete the renaming of tree nodes. But the tree control can also complete the rename operation by clicking the mouse anywhere on the tree control after typing the new string for the folder. I dont want the rename to take place by mouse click. I know how to revert the old string of the tree node .But I dont know what event completed the rename operation .Like if i can differentiate the end of rename operation by mouse or by keyboard i can block the mouse rename operation. I tried to do the following filter . void CTreeCtrlBar::OnTvnEndlabeleditTree1(NMHDR *pNMHDR, LRESULT *pResult) { NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; if (pNMTreeView->action == TVC_BYKEYBOARD) AfxMessageBox("End by ENTER Key"); else if (pNMTreeView->action == TVC_BYMOUSE) AfxMessageBox("End by mouse click"); ************************************************************************** But always the condition pNMTreeView->action == TVC_BYMOUSE gets satisfied even when I pressed ENTER key to complete the rename operation. Any suggestions please. laiju