Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
MFC
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

CListCtrl::MapIDToIndex

Maps the unique ID of an item in the current list-view control to an index.

UINT MapIDToIndex(
     UINT id
) const;

Parameter

Description

[in] id

The unique ID of an item.

The current index for the specified ID.

A list-view control internally tracks items by index. This can present problems because indexes can change during the control's lifetime. The list-view control can tag an item with an ID when the item is created and you can use this ID to guarantee uniqueness during the lifetime of the list-view control.

Note that in a multithreaded environment the index is guaranteed only on the thread that hosts the list-view control, not on background threads.

This method sends the LVM_MAPIDTOINDEX message, which is described in the Windows SDK.

Header: afxcmn.h

This control is supported in Windows XP and later.

Additional requirements for this method are described in Build Requirements for Windows Vista Common Controls.

Community Additions

ADD
Show:
© 2015 Microsoft