Page 1 of 1

Selecting items in a selfmade listbox

Posted: Fri Mar 18, 2005 4:38 pm
by Hroudtwolf
Hello PB-World,

I've made a listbox by myself per API.

Code: Select all

ListArea1 = CreateWindowEx_(0,"Listbox","",#WS_CHILD|#WS_VISIBLE|#LBS_NOTIFY |#WS_VSCROLL |#LBS_DISABLENOSCROLL|#LBS_NOINTEGRALHEIGHT   ,20,302,246,120,WindowID(1),0,GetModuleHandle_(0),0)
SendMessage_(ListArea1,#WM_SETFONT,GetStockObject_(#DEFAULT_GUI_FONT),1)
How to select items ?

SendMessage_(ListArea1,#??_?????????,???,???)

Can anybody help me ?

Posted: Fri Mar 18, 2005 7:11 pm
by localmotion34
this is how to set the selection:

sendmessage_(listboxhandle,#lb_setsel,#true,itemnubmer)

im curious. the default window procedure for listboxes automatically sets the selected item for you. have you subclassed the listbox or done something else to remove the #wm_lbuttondown message from the processing que?

Posted: Fri Mar 18, 2005 8:02 pm
by Hroudtwolf
Thx :!: