|
-
March 31st, 2007, 12:48 PM
#1
tree view get info from selected item
Hello, i have a tree view control with lots of items. I wanna to make context menu to each item (due to lets say its bmp image in tree) on right click.
Everything works perfect, I can get HTREEITEM of selected item with right click, but I am not sure how to continue.
The selected item - HTREEITEM - is in Selected (or also in tinf.hItem, I suppose): Selected = TreeView_HitTest(hTree, &tinf); //WORKS
I thought I should do something like this (to find out if selected item has g_Image1 bitmap):
TVITEM item;
item.hItem = tinf.hItem; (or Selected)
item.iImage = g_Image1;
item.iSelectedImage = g_Image1;
item.mask = TVIF_SELECTEDIMAGE | TVIF_IMAGE;
and then call some:
SendDlgItemMessage(hwnd, IDC_TREE, TVM_GETITEM, TVGN_CARET, (LPARAM)&item); (to retrieve complet data to the same item, and access it later) ... but this doesnt works.
Did I missunderstand it? How can I get some info from selected item if I have only its HTREEITEM .
Thank YOU.
-
April 3rd, 2007, 07:12 PM
#2
Re: tree view get info from selected item
Why are you setting iImage and iSelectedImage? Set hItem only, since that is what you are searching on.
Henri Hein
Principal Engineer, Propel
Do not credit Propel with my views or opinions.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|