I wrote:
hItem = m_tree1.InsertItem(L"Car Listing", TVI_ROOT);
hCar = m_tree1.InsertItem(L"Economy", hItem);
m_tree1.InsertItem(L"BH-733", hCar);
m_tree1.InsertItem(L"SD-397", hCar);
m_tree1.InsertItem(L"JU-538", hCar);
m_tree1.InsertItem(L"DI-285", hCar);
m_tree1.InsertItem(L"AK-830", hCar);
hCar = m_tree1.InsertItem(L"Compact", hItem);
m_tree1.InsertItem(L"HG-490", hCar);
m_tree1.InsertItem(L"PE-473", hCar);
hCar = m_tree1.InsertItem(L"Standard", hItem);
m_tree1.InsertItem(L"SO-398", hCar);
m_tree1.InsertItem(L"DF-438", hCar);
m_tree1.InsertItem(L"IS-833", hCar);
hCar = m_tree1.InsertItem(L"Full Size", hItem);
m_tree1.InsertItem(L"PD-304", hCar);
hCar = m_tree1.InsertItem(L"Mini Van", hItem);
m_tree1.InsertItem(L"ID-497", hCar);
m_tree1.InsertItem(L"RU-304", hCar);
m_tree1.InsertItem(L"DK-905", hCar);
hCar = m_tree1.InsertItem(L"SUV", hItem);
m_tree1.InsertItem(L"FE-948", hCar);
m_tree1.InsertItem(L"AD-940", hCar);
hCar = m_tree1.InsertItem(L"Truck", hItem);
m_tree1.InsertItem(L"HD-394", hCar);
I want to obtain hcar when I click on a hcar tree Control
I wrote:
void CMFCApplication9Dlg::OnNMDblclkTree2(NMHDR *pNMHDR, LRESULT *pResult)
{
*pResult = 0;
CString sText = m_tree1.GetItemText(hCar);
m_text.SetWindowText(sText);
}
but on my Edit control it's written truck..I don't know why
What I have tried:
I want word everytime where I click..how can I write?