hi, programmers!
i want to increase the width of a drop-down list, i uses CB_SETDROPPEDWIDTH message, you see:
.ELSEIF uMsg == WM_COMMAND
mov eax, wParam
mov edx, eax
shr edx, 16
.IF dx == CBN_DROPDOWN
INVOKE SendMessage, hComboBox, CB_SETDROPPEDWIDTH, 70, 0
but it dont work :( whats wrong with my code ?
Posted on 2004-03-09 20:03:57 by benny
hi,

put call into WM_INITDIALOG or WM_CREATE (whichever you use)

invoke SendDlgItemMessage, hWin, IDC_CBO, CB_SETDROPPEDWIDTH, 190, 0

or

invoke SendMessage, hComboBox, CB_SETDROPPEDWIDTH, 190, 0

Did you get handle to combo in hComboBox ?

bye
X05
Posted on 2004-03-09 20:21:42 by X05
thank you X05
i will try
Posted on 2004-03-09 20:29:15 by benny
i try it again, but fail !
how i can use CBN_DROPDOWN message ?
how i can use CB_SETDROPPEDWIDTH message ?

whats wrong with my asmcode ?? :(
Posted on 2004-03-09 21:44:15 by benny
Hi :)

The code seems fine, but the height of the combo box is wrong. No dropdown list is shown because you need to change the combo box height (at your resource script) to fit the list.
Posted on 2004-03-10 11:39:49 by QvasiModo
Hi Benny,

I have not looked at your code but from the width of 70 I think your problem might be a misunderstanding of the purpose of the message. It is to set the minimum width of a combo box. The width you specify will always grow to include the full width of the edit part of the combo box if that is larger. So, you cannot have a listbox that is smaller than the width of the edit component of the control. So if you have a combo that has it's width set to 100 pixels and use CB_SETDROPPEDWIDTH to set the width to 70, it will have no effect at all, the width will still be 100.

The purpose of the CB_SETDROPPEDWIDTH message is only to expand the listbox if the text is not completely displaying, it will never shrink the listbox to a width less than the edit component.

WMCOMMAND:

movzx eax,W[wParam+2]
cmp eax,CBN_DROPDOWN
jne >.EXIT
invoke SendMessage,[lParam],CB_SETDROPPEDWIDTH,200,0
jmp >.EXIT
Posted on 2004-03-10 12:40:39 by donkey
problem removed !:) thank you!
Posted on 2004-03-10 21:33:31 by benny