Today I create a coolbar(rebar), and put several bands on it. everything is OK except that when the main window is created, each band covers a row seperately. I want two bands share one row when the main window is created, what shall I do?
Here is the code. I want the band contains combobox1 and the band contains combobox2 share one row.


;---------------[ create rebar ]-----------------------------------------------
invoke CreateWindowEx,WS_EX_TOOLWINDOW, addr szcRebar, \
NULL, WS_CHILD or WS_VISIBLE or WS_CLIPSIBLINGS or \
WS_CLIPCHILDREN or RBS_VARHEIGHT or RBS_AUTOSIZE or \
CCS_NODIVIDER or RBS_BANDBORDERS, \
0, 0, 0, 0, hMainWnd, IDC_REBAR, hInstance, NULL
mov hRebar, eax
mov @rbi.cbSize, sizeof REBARINFO
mov @rbi.fMask, 0
mov @rbi.himl, NULL
invoke SendMessage, hRebar, RB_SETBARINFO, 0, addr @rbi
;---------------[ create toolbar ]---------------------------------------------
;....
;---------------[ create combobox1 ]-------------------------------------------
invoke CreateWindowEx, 0, offset szcCombobox, \
offset szcCombobox, WS_VISIBLE or WS_CHILD or \
CBS_DROPDOWN, 0, 0, 0, 0, hMainWnd, \
IDC_COMBOBOX1, hInstance, NULL
mov hCombobox1, eax

mov @rbBand.cbSize, sizeof REBARBANDINFO
mov @rbBand.lpText, offset szComboInfo
mov @rbBand.fMask, RBBIM_STYLE or RBBIM_CHILD or \
RBBIM_CHILDSIZE or RBBIM_SIZE or RBBIM_COLORS or \
RBBIM_TEXT
mov @rbBand.fStyle, RBBS_BREAK or RBBS_CHILDEDGE or \
RBBS_GRIPPERALWAYS
mov eax, hCombobox1
mov @rbBand.hwndChild, eax
invoke GetSysColor, COLOR_BTNTEXT
mov @rbBand.clrFore, eax
invoke GetSysColor, COLOR_BTNFACE
mov @rbBand.clrBack, eax
mov @rbBand.lx, 50
mov @rbBand.cyMinChild, 20
mov @rbBand.cxMinChild, 200
invoke SendMessage, hRebar, RB_INSERTBAND, -1, addr @rbBand
;---------------[ create combobox1 ]-------------------------------------------
invoke CreateWindowEx, 0, offset szcCombobox, \
offset szcCombobox, WS_VISIBLE or WS_CHILD or \
CBS_DROPDOWN, 0, 0, 0, 0, hMainWnd, \
IDC_COMBOBOX2, hInstance, NULL
mov hCombobox2, eax

mov @rbBand.cbSize, sizeof REBARBANDINFO
mov @rbBand.lpText, offset szEditInfo
mov @rbBand.fMask, RBBIM_STYLE or RBBIM_CHILD or \
RBBIM_CHILDSIZE or RBBIM_SIZE or RBBIM_COLORS or \
RBBIM_TEXT
mov @rbBand.fStyle, RBBS_BREAK or RBBS_CHILDEDGE or \
RBBS_GRIPPERALWAYS
mov eax, hCombobox2
mov @rbBand.hwndChild, eax
invoke GetSysColor, COLOR_BTNTEXT
mov @rbBand.clrFore, eax
invoke GetSysColor, COLOR_BTNFACE
mov @rbBand.clrBack, eax
mov @rbBand.lx, 250
mov @rbBand.cyMinChild, 20
mov @rbBand.cxMinChild, 100
invoke SendMessage, hRebar, RB_INSERTBAND, -1, addr @rbBand
Posted on 2003-01-09 22:21:53 by minglei_lee
Remove RBBS_BREAK flag.
Posted on 2003-01-09 22:34:29 by comrade
Thank you very much!
Posted on 2003-01-09 22:39:55 by minglei_lee