in my prog i wanna create a combobox and add some strings. this is the basic idea:

ClassCombo db "combobox", 0
szText db "text", 0

; ... some code

; create combobox
invoke CreateWindowEx, WS_EX_CLIENTEDGE, addr ClassCombo, NULL, WS_VISIBLE or WS_CHILD or CBS_DROPDOWNLIST, 115, 132, 60, 20, hWnd, NULL, hInstance, NULL
mov hCombo, eax

afterwards i want to add some strings with this:
invoke SendMessage, hCombo, CB_ADDSTRING, addr szText, 0

since i create the combo at startup, i also add the strings on program startup. BUT: the combobox does not display the strings. what's the hangup about this?
Posted on 2002-10-10 16:23:21 by ploptor
is it possible that i'm confusing wParam and lParam of the SendMessage API?
Posted on 2002-10-10 16:34:55 by ploptor
Yes, it is possible :grin:.


(HWND) hWnd, // handle to destination window
CB_ADDSTRING, // message to send
(WPARAM) wParam, // not used; must be zero
(LPARAM) lParam // string to add (LPCTSTR)
Posted on 2002-10-10 16:45:24 by LuHa
well, i exchanged it --- but still nothing ... :(
Posted on 2002-10-10 18:08:13 by ploptor
If I'm not mistaken, the problem is with your CreateWindowEx. Change the height of the window to something bigger than 20. With combo boxes, the height doesn't mean the height of the control, but actually the list box that pops up. Basically, since the edit control portion of the combo box is roughly 24 pixels high, your list box is being obscured

Posted on 2002-10-10 23:09:04 by chorus
thanks. that was it. the control was to small.
Posted on 2002-10-11 07:03:27 by ploptor