Hi, there's problem with toolbars inside rebar control for me. I CAN'T figure it out!!
When I create the controls they sit in place. When I make the window smaller with the mouse, they behave too.
But when I drag the window larger than it was initialy created with the mouse, the topmost big toolbar inside the rebar, shifts to the left, covering it's own gripper (maybe it's actually on top of the rebar control now, I don't know), and the small toolbar just moves from it's position to sit concealed under the topmost big toolbar.

I have to screenshots here to illustrate

Before resizing to larger :



and this is after resizing :



The toolbars are just containing iconlists. I don't understand what's happening.

This is how I create the toolbars, ( hope you don't mind some c-code ):



HWND __stdcall Toolbar_Create(HWND hWnd, HINSTANCE hInst, int toolbarID, int butWidth, int butHeight)
{
HWND hToolbar;

hToolbar = CreateWindowEx(0, TOOLBARCLASSNAME, NULL,\
TBSTYLE_FLAT|TBSTYLE_TRANSPARENT|TBSTYLE_TOOLTIPS|WS_CHILD|WS_VISIBLE, 0, 0, 0, 0,
hWnd, (HMENU)toolbarID, hInst, NULL);

SendMessage(hToolbar, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);
SendMessage(hToolbar, TB_SETBITMAPSIZE, 0, (LPARAM) MAKELONG(butWidth, butHeight));
SendMessage(hToolbar, TB_AUTOSIZE, 0, 0);

return hToolbar;
}


This is how I add the controls to bands in rebar ( hControl is handle ofthe control to add to rebar ):



REBARBANDINFO Rbi;
RECT Rect;
int w,h;

ZeroMemory(&Rbi, sizeof(Rbi));

GetWindowRect(hControl, &Rect);
h= Rect.bottom-Rect.top;
w = Rect.right-Rect.left;

Rbi.cbSize = sizeof(REBARBANDINFO);
Rbi.fMask = RBBIM_STYLE | RBBIM_CHILD | RBBIM_CHILDSIZE| RBBIM_SIZE| RBBIM_TEXT;
Rbi.hwndChild = hControl;
Rbi.cxMinChild = w;
Rbi.cyMinChild = h;
Rbi.cx = w ;
Rbi.cxIdeal = w;
Rbi.fStyle = RBBS_CHILDEDGE|RBBS_GRIPPERALWAYS;
Rbi.lpText = pszText;
Rbi.cch = strlen(pszText);

return SendMessage(hRebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&Rbi);


If somebody would know what's wrong, I'm very happy ( I've been trying find out what's wrong for a week )
Posted on 2003-05-04 06:48:18 by david
Yes, hehh, sorry about the c-code should be in heap :o ! I wanted still ask about the problem even though it's not asm code because I think there's no other forum on the net where there's as much people with such great knowledge and experience of programming with the win32-api's.
Posted on 2003-05-04 16:20:59 by david