Share via


LB_ADDSTRING

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This message is sent by an application to add a string to a list box. If the list box does not have the LBS_SORT style, the string is added to the end of the list. Otherwise, the string is inserted into the list and the list is sorted.

Syntax

LB_ADDSTRING wParam = 0; 
    lParam = (LPARAM)(LPCTSTR) lpsz;

Parameters

  • wParam
    Not used.
  • lpsz
    Long pointer to the null-terminated string to be added.

    If you create the list box with an owner-drawn style, but without the LBS_HASSTRINGS style, the value of the lpsz parameter is stored as item data instead of the string it would otherwise point to. You can send the LB_GETITEMDATA and LB_SETITEMDATA messages to retrieve or modify the item data.

Return Value

The zero-based index of the string in the list box indicates success. LB_ERR indicates that an error has occurred. LB_ERRSPACE indicates that there is insufficient space to store the new string.

Requirements

Header winuser.h
Windows Embedded CE Windows CE 1.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

LB_DELETESTRING
LB_GETITEMDATA
LB_INSERTSTRING
LB_SELECTSTRING
LB_SETITEMDATA
List Boxes Messages