CompuServe Thread

#OwnerDraw Listbox Sort

3 messages in this thread
#30387From: Charles SteinhardtJul 9, 1994 8:00 PM
Well Kevin, The CD workd great!! (Now I'm awaiting a new front bezel as NEC needs you to request a different bezel for Compaq & IBM Machines!!! Anyhow, while I can't find any direct support for your threory – I've certainly found implied support for your supposition regarding LBS_HASSTRINGS: MSJ – Volume 5 – Number 4 (July, 1990) The LBS_SORT style gets a little tricky with owner draw list boxes. If LBS_HASSTRINGS is set, it's just as easy as before-Windows will take care of the sorting on its own. But without LBS_HASSTRINGS, there's no way for Windows to determine the sort order. So when you send an LB_ADDSTRING message to insert an entry, Windows sends back one or more WM_COMPAREITEM messages to the list box's owner. Like the compare routine called back by the C run-time library's qsort function, this message lets you specify the sort ordering by comparing pairs of items. Will your ListBox work without this style? Charles Steinhardt[MVP], OMG Inc. Written 09-Jul-1994 @ 20:58:05 Windows NavCIS PRO 1.21 !^NavFont01F000EMGHHGF5MIE0HJK823A
#30484From: Kevin MaisanoJul 11, 1994 7:16 AM
Charles: Thanks for your responses. Unfortunately, I need the LBS_HASSTRINGS style because I do use the LB_GETTEXT message. Any ideas? Kev.
#30534From: Charles SteinhardtJul 11, 1994 1:31 PM
I can only tell you that when I use an OwnerDraw listbox, I also handle the WM_DRAWITEM myself. I usually have pointers (these pointers are from an array that contains the strings or whatever) in the listbox instead of strings (which allows for MANY more items in a listbox). In WM_DRAWITEM – I get the current listbox line's pointer – and then use drawtext to write out the text. Charles Steinhardt[MVP], OMG Inc. Written 11-Jul-1994 @ 14:29:26 Windows NavCIS PRO 1.21 !^NavFont01F0007MGHHH39A52E