I have following structure:
struct Tournaments
{
unsigned int id;
unsigned int itemid;
};
struct Tournaments Tournament;
I assign values to Tournament:
Tournament.id = 1;
Tournament.itemid = 2;
...in the code I insert this structure in my treeview.lParam item:
tvinsert.hParent = hParent;
Before = hParent;
tvinsert.hInsertAfter = TVI_LAST;
tvinsert.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
tvinsert.item.pszText = szEventName;
tvinsert.item.lParam = (LPARAM) &Tournament;
tvinsert.item.iImage = 9;
tvinsert.item.iSelectedImage = 9;
Parent = (HTREEITEM) SendMessage(g_hwndTreeview, TVM_INSERTITEM, 0, (LPARAM) &tvinsert);
...and in the Notify code I retrieve the item back:
tvi.mask = TVIF_PARAM | TVIF_TEXT;
SendMessage(g_hwndTreeview, TVM_GETITEM, 0, (LPARAM) &tvi);
Assuming tvi holds the structure previously inserted, how can I get hold of
the structure items id & itemid ??
If necessary I can provide the whole code...