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