Export (0) Print
Expand All

CB_INITSTORAGE message

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

Parameters

wParam

The number of items to add.

lParam

The amount of memory to allocate for item strings, in bytes.

Return value

If the message is successful, the return value is the total number of items for which memory has been pre-allocated, that is, the total number of items added by all successful CB_INITSTORAGE messages.

If the message fails, the return value is CB_ERRSPACE.

Windows NT 4.0: This message does not allocate the specified amount of memory; however, it always returns the value specified in the wParam parameter.

Windows 2000/XP: The message allocates memory and returns the success and error values described above.

Remarks

The CB_INITSTORAGE message helps speed up the initialization of combo boxes that have a large number of items (over 100). It reserves the specified amount of memory so that subsequent CB_ADDSTRING, CB_INSERTSTRING, and CB_DIR messages take the shortest possible time. You can use estimates for the wParam and lParam 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

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winuser.h (include Windows.h)

See also

Reference
CB_ADDSTRING
CB_DIR
CB_INSERTSTRING

 

 

Community Additions

ADD
Show:
© 2014 Microsoft