Maps the ID of an item to an index. You can use this macro or send the LVM_MAPIDTOINDEX message explicitly.
A handle to the list-view control.
A UINT that contains the unique ID of an item.
Returns the most current index.
List-view controls internally track items by index. This can present problems because indexes can change during the control's existence.
You can use this macro to tag an item with an ID when you create the item. You use this ID to guarantee uniqueness during the existence of the list-view control.
If you need to know the index of an item after creating an ID, call LVM_MAPIDTOINDEX with the unique ID and it returns the most current index.
Note In a multithreaded environment, you can only be sure the correct index is returned on the thread that hosts the list-view control, not on background threads.
To use ListView_MapIDToIndex, specify Comctl32.dll version 6 in the manifest. For more information on manifests, see Enabling Visual Styles.
Minimum supported client
|Windows XP [desktop apps only]|
Minimum supported server
|Windows Server 2003 [desktop apps only]|
Build date: 10/27/2012