i stumbled across this code. it seems different but shorter than what i was plannin to use but it has problems. second i have no clue where to put or what to do with it i understand it a kinda bit well i know what it means and stuff it for a tree control
[

typedef struct _TV_ITEM {
UINT mask;
HTREEITEM hItem;
UINT state;
UINT stateMask;
LPSTR pszText;
int cchTextMax;
int iImage;
int iSelectedImage;
int cChildren;
LPARAM lParam;
} TV_ITEM;

typedef struct _TV_INSERTSTRUCT {
HTREEITEM hparent;
HTREEITEM hInsertAfter;
TV_ITEM item;
} TV_INSERTSTRUCT;

TV_ITEM tvItem;
tvItem.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
tvItem.pszText = "Root";
tvItem.cchTextMax = 4;
tvItem.iImage = 0;
tvItem.iSelectedImage = 1;
TV_INSERTSTRUCT tvInsert;
tvInsert.hParent = NULL;
tvInsert.hInsertAfter = TVI_FIRST;
tvInser.item = tvItem;
HTREEITEM hRoot = m_treeView.InsertItem(&tvInsert);
]
I understand from this book thingy that the structures are for the items. thats the root item if you dont notice. i havent altered this code yet.