CB_INITSTORAGE
This message is sent by an application 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.
CB_INITSTORAGE wParam = (WPARAM)(int) cItems;
lParam = (LPARAM)(DWORD) cb;
Parameters
- cItems
Specifies the number of items to add. - cb
Specifies the amount of memory to allocate for item strings, in bytes.
Return Values
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—indicates success. CB_ERRSPACE indicates failure.
Windows NT: For Windows NT version 4.0, this message does not allocate the specified amount of memory; however, it always returns the value specified in the cItems parameter. For Windows NT version 5.0, the message allocates memory and returns the success and error values described above.
Remarks
The lParam parameter is unused in Windows CE.
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 and CB_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
| Runs On | Versions | Defined in | Include | Link to |
|---|---|---|---|---|
| Windows CE OS | 1.0 and later | Winuser.h |
Note This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.
See Also
Last updated on Tuesday, July 13, 2004
© 1992-2000 Microsoft Corporation. All rights reserved.