Share via


LB_INITSTORAGE

This message allocates memory for storing list box items. An application sends this message before adding a large number of items to a list box.

LB_INITSTORAGE wParam = (WPARAM)(int) cItems;
  lParam = (LPARAM)(DWORD) cb;

Parameters

  • cItems
    Specifies the number of items to add.
  • cb
    Specifies the amount of memory, in bytes, to allocate for item strings.

Return Values

The total number of items for which memory has been preallocated — that is, the total number of items added by all successful LB_INITSTORAGE messages — indicates success. LB_ERRSPACE indicates failure.

Remarks

The lParam parameter is unused in Windows CE.

The LB_INITSTORAGE message helps speed up the initialization of list boxes that have a large number of items (more than 100). It reserves the specified amount of memory so that subsequent LB_ADDSTRING and LB_INSERTSTRING messages take the shortest possible time. You can use estimates for the cItems and cb parameters. If you overestimate, the extra memory is allocated; if you underestimate, the normal allocation is used for items that exceed the requested amount.

Requirements

OS Versions: Windows CE 1.0 and later.
Header: Winuser.h.

See Also

LB_ADDSTRING | LB_INSERTSTRING | List Box Messages

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.