Windows Mobile 6.5
A version of this page is also available for

This macro maps the index of an item to a unique identifier (ID). You can use this macro or send the LVM_MAPINDEXTOID message explicitly.

UINT ListView_MapIndexToID(
   HWND hwnd,
   UINT index


Handle to the list-view control.


UINT that contains the index of an item.

Returns a unique ID.

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.

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.

Windows Embedded CEWindows CE 5.0 and later
Windows MobileWindows Mobile Version 5.0 and later

Community Additions