【MFC】Tree控件响应点击事件

// 选择一个的时候
void CResourceTable::OnTvnSelchangedTree1(NMHDR *pNMHDR, LRESULT *pResult)
{
	LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR);
	// TODO:  在此添加控件通知处理程序代码

	if (m_isInitData)
	{
		HTREEITEM CurrentItem  = m_tree.GetSelectedItem();
		HTREEITEM ParentItem = m_tree.GetParentItem(CurrentItem);
		CString Root = m_tree.GetItemText(ParentItem);
		if (!Root.IsEmpty())
		{
			CString S1 = m_tree.GetItemText(CurrentItem);
			DWORD itemData = m_tree.GetItemData(CurrentItem);
			PIMAGE_RESOURCE_DATA_ENTRY pLast = (PIMAGE_RESOURCE_DATA_ENTRY)(itemData);
			//S1.Format(L"%08X 大小:%d 文件偏移:%08X", pLast->OffsetToData, pLast->Size, pPETool->RVA2FOA(pLast->OffsetToData));
			//MessageBox(S1);
			// 

			// RVA
			S1.Format(L"%08X", pLast->OffsetToData);
			m_RVA = S1;

			// 偏移
			S1.Format(L"%08X", pPETool->RVA2FOA(pLast->OffsetToData));
			m_Offset = S1;

			// 大小
			S1.Format(L"%08X", pLast->Size);
			m_Size = S1;


			UpdateData(FALSE);
		}
		
	}
	

	*pResult = 0;
}

 

文 / luna
LEAVE A REPLY

loading