Selecting items in a selfmade listbox

Windows specific forum
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Selecting items in a selfmade listbox

Post 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 ?
localmotion34
Enthusiast
Enthusiast
Posts: 665
Joined: Fri Sep 12, 2003 10:40 pm
Location: Tallahassee, Florida

Post 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?

Code: Select all

!.WHILE status != dwPassedOut
! Invoke AllocateDrink, dwBeerAmount
!MOV Mug, Beer
!Invoke Drink, Mug, dwBeerAmount
!.endw
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

Thx :!:
Post Reply