ComboBox_AddItemData macro (windowsx.h)

Adds item data to the list in a combo box at the specified location. You can use this macro or send the CB_ADDSTRING message explicitly.

Syntax

int ComboBox_AddItemData(
   HWND   hwndCtl,
   LPARAM data
);

Parameters

hwndCtl

Type: HWND

A handle to the control.

data

Type: LPARAM

A pointer to the item data to add.

Return value

Type: int

The return value is the zero-based index of the item in the list. If an error occurs, the return value is CB_ERR. If there is insufficient space to store the new string, the return value is CB_ERRSPACE.

Remarks

Use this macro for a list in a combo box with an owner-drawn style but without the CBS_HASSTRINGS style. For more information, see CB_ADDSTRING.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header windowsx.h