LB_SETITEMDATA Message
LB_SETITEMDATA Message

Sets a value associated with the specified item in a list box.

Syntax

To send this message, call the SendMessage function as follows.
lResult = SendMessage(    // returns LRESULT in lResult
   hWndControl,           // (HWND) handle to destination control
   LB_SETITEMDATA,        // (UINT) message ID
   wParam,                // = () wParam; 
   lParam                 // = () lParam;
);

Parameters

wParam
Specifies the zero-based index of the item. If this value is -1, the lParam value applies to all items in the list box.

Microsoft Windows 95/Windows 98/Windows Millennium Edition (Windows Me): The wParam parameter is limited to 16-bit values. This means list boxes cannot contain more than 32,767 items. Although the number of items is restricted, the total size in bytes of the items in a list box is limited only by available memory.

lParam
Specifies the value to be associated with the item.

Return Value

If an error occurs, the return value is LB_ERR.

Remarks

If the item is in an owner-drawn list box created without the LBS_HASSTRINGS style, this message replaces the value contained in the lParam parameter of the LB_ADDSTRING or LB_INSERTSTRING message that added the item to the list box.

Message Information

HeaderDeclared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 3.1

See Also

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
Page view tracker