ListView_MapIDToIndex (Windows CE 5.0)

Send Feedback

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

UINT ListView_MapIDToIndex(   HWND hwnd,   UINT id);

Parameters

  • hwnd
    Handle to the list-view control.
  • id
    UINT that contains the unique ID of an item.

Return Values

Returns the most current index.

Remarks

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 you create 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.

Requirements

OS Versions: Windows CE 5.0 and later.
Header: Commctrl.h.

See Also

List-View Controls Macros

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.