An application sends a CB_ADDSTRING message to add a string to the list box of a combo box. If the combo box does not have the CBS_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.
CB_ADDSTRING wParam = 0; // not used; must be zero lParam = (LPARAM) (LPCTSTR) lpsz; // address of string to add
The return value is the zero-based index to the string in the list box of the combo box. If an error occurs, the return value is CB_ERR. If insufficient space is available to store the new string, it is CB_ERRSPACE.
If you create an owner-drawn combo box with the CBS_SORT style but without the CBS_HASSTRINGS style, the WM_COMPAREITEM message is sent one or more times to the owner of the combo box so the new item can be properly placed in the list.
To insert a string at a specific location within the list, use the CB_INSERTSTRING message.
CB_DIR, CB_INSERTSTRING, WM_COMPAREITEM
|file: /Techref/os/win/api/win32/mess/src/msg01_9.htm, 2KB, , updated: 2000/4/7 12:19, local time: 2022/5/22 00:02,
|©2022 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?|
<A HREF="http://www.piclist.com/techref/os/win/api/win32/mess/src/msg01_9.htm"> CB_ADDSTRING</A>
|Did you find what you needed?|
PICList 2022 contributors:
o List host: MIT, Site host massmind.org, Top posters @20220522
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.
Welcome to www.piclist.com!