The information in this article applies to:
SUMMARYIn the Microsoft Windows graphical environment, an application can use the LB_SETITEMDATA and LB_GETITEMDATA messages to associate additional information with each entry in a list box. These messages enable an application to associate an arbitrary LONG value with each entry and to retrieve that value. This article documents how an application uses these messages. MORE INFORMATION
In this example, the application will associate a 64-byte block of data
with each list box entry. This is accomplished by allocating a global
memory block and using the LB_SETITEMDATA message to associate the handle
of the memory block with the appropriate list box item.
To retrieve the information associated with a list box entry, the following
code can be used:
Before the application terminates, it must free the memory associated with
each list box item. The following code frees the memory associated with one
list box item:
These techniques can be used to associated data with an entry in a combo
box by substituting the CB_SETITEMDATA and CB_GETITEMDATA messages.
Additional query words: combobox listbox
Keywords : kbCtrl kbListBox kbNTOS kbWinOS2000 kbSDKWin32 kbGrpUser kbWinOS |
Last Reviewed: January 28, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |