ListBox_InsertString macro (windowsx.h)

Adds a string to a list box at the specified location. You can use this macro or send the LB_INSERTSTRING message explicitly.

Syntax

int ListBox_InsertString(
   HWND   hwndCtl,
   int    index,
   LPCSTR lpsz
);

Parameters

hwndCtl

Type: HWND

A handle to the control.

index

Type: int

The zero-based index at which to insert the string, or –1 to add it to the end of the list.

lpsz

Type: LPCSTR

The string to add.

Return value

Type: int

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

Remarks

For more information, see LB_INSERTSTRING.

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