MrDoomMaster
November 25th, 2004, 06:08 PM
Please use Win32 only, no MFC. Thank you.
Since I sort my items in my list view, it is pretty much impossible to use an item's index value to reference it, considering that an items index is based on its position in the list view, from top to bottom.
To compensate for this, I reference an item based on its lParam value in LVITEM struct. When I add an item, I configure the lParam item of the LVITEM structure with a unique value that I can use to reference the item, no matter what position it has in the list view.
The only problem is that most of the list view macros supplied by Windows API requires the index value of the item, not the lparam. Hence I need a function that can do one of the following:
1. A function that accepts an lParam value and returns the item's index value.
2. A function that accepts an lParam value and returns the item's LVITEM structure, which will contain the item's index AND lparam value, along with several other properties.
I hope someone can help me out, because I"ve been reading MSDN and I've come up with nothing helpful yet.
Thank you!
Since I sort my items in my list view, it is pretty much impossible to use an item's index value to reference it, considering that an items index is based on its position in the list view, from top to bottom.
To compensate for this, I reference an item based on its lParam value in LVITEM struct. When I add an item, I configure the lParam item of the LVITEM structure with a unique value that I can use to reference the item, no matter what position it has in the list view.
The only problem is that most of the list view macros supplied by Windows API requires the index value of the item, not the lparam. Hence I need a function that can do one of the following:
1. A function that accepts an lParam value and returns the item's index value.
2. A function that accepts an lParam value and returns the item's LVITEM structure, which will contain the item's index AND lparam value, along with several other properties.
I hope someone can help me out, because I"ve been reading MSDN and I've come up with nothing helpful yet.
Thank you!