|
-
May 18th, 1999, 07:43 AM
#1
CListControl
Hi all,
how can i get the LV_ITEM structure of an item inserted in the list control. The GetItem() function didn't work for me. It's returning unexpected values. How can I mention which item to be retrieved.please inform if anyone find information about this
thanks in advance
bye
-
May 18th, 1999, 09:38 AM
#2
Re: CListControl
The GetItem function takes a pointer to a LV_ITEM that describes the Item you want, and then fills in the pointer with the corresponding item's info.
So, I think you would have to do something like.
LV_ITEM Item;
Item.mask = LVIF_TEXT; // or whatever your mask is
Item.iItem = 10;
m_List.GetItem (&Item);
--michael
-
May 19th, 1999, 12:39 AM
#3
Re: CListControl
Hello,
I tried this method and it didn't work. It's returning whatever value I initialized to the iImage item even after calling GetItem(&item) with appropriate index and mask fields. Can you please suggest some idea how to retrieve the iImage item of the selected item in the listcontrol.
bye
-
May 19th, 1999, 10:10 AM
#4
Re: CListControl
I would expect something like this to work.
int iImage = 0;
int iItem = m_List.GetNextItem (-1, LVIS_SELECTED);
if (iItem != -1)
{
LV_ITEM Item;
memset (&Item, 0, sizeof LV_ITEM);
Item.iItem = iItem;
m_List.GetItem (&Item);
if (Item.mask & LVIF_IMAGE)
iImage = Item.iImage;
}
--michael
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
|