public static extern void SendMessage(IntPtr hWnd, int msg, int wParam, ref TVITEM lParam);
string GetItemText(IntPtr hTreeItem) { string text; TVITEM tvi = new TVITEM(); tvi.hItem = hTreeItem; tvi.mask = (int)TreeViewItemFlags.TVIF_TEXT; tvi.cchTextMax = 80; tvi.pszText = Marshal.AllocHGlobal(80); WindowsAPI.SendMessage(Handle, (int)TreeViewMessages.TVM_GETITEMW, 0, ref tvi); text = Marshal.PtrToStringAuto(tvi.pszText); return text; }
public static extern void SendMessage(IntPtr hWnd, int msg, int wParam, ref TVITEM lParam);