CB_SETITEMDATA Message
CB_SETITEMDATA Message

An application sends a CB_SETITEMDATA message to set the value associated with the specified item in a combo box.

Syntax

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

Parameters

wParam
Specifies the item's zero-based index.
lParam
Specifies the new value to be associated with the item.

Return Value

If an error occurs, the return value is CB_ERR.

Remarks

If the specified item is in an owner-drawn combo box created without the CBS_HASSTRINGS style, this message replaces the value in the lParam parameter of the CB_ADDSTRING or CB_INSERTSTRING message that added the item to the combo 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