im able to put a combobox on a toolbar. the problem is my toolbar wont always have the same amount of buttons on it. so i need to get the total amount of buttons on the toolbar, multiply that amount by 16 (because thats the width of each of my buttons) and add 5 (just to make a little space between my comboxbox and the buttons) to that amount. this total will give me the location of where i need my combobox to start at on the toolbar. here is the code i was working with but it isnt working.
invoke SendMessage,hToolBar,TB_BUTTONCOUNT,0,0  ;get button count

shl eax, 8 ;multiply count by 16 to get length of buttons
add eax, 5 ;add 5 to the length to make a little space
mov len, eax ;mov the total into a variable to preserve


invoke CreateWindowEx, 0,
ADDR ComboBoxClass,
0,
WS_CHILD + WS_VISIBLE,
addr len,0,200,1,
hToolBar,
0,
hInstance,
0
mov hComboBox,eax
Posted on 2002-05-05 20:42:29 by smurf
To multiply by 16 use shl eax, 4
Posted on 2002-05-05 21:21:45 by Kudos
Also, you should not need the addr len. Just use len.
Posted on 2002-05-05 21:32:01 by anon