int height = OS.SendMessage (handle, OS.RB_GETBARHEIGHT, 0, 0); setSize (size.x, height + (border * 2));
int barHeight = OS.SendMessage (handle, OS.RB_GETBARHEIGHT, 0, 0); if ((style & SWT.VERTICAL) != 0) { setSize (barHeight + 2 * border, size.y); } else { setSize (size.x, barHeight + 2 * border); }
LRESULT wmNotifyChild (int wParam, int lParam) {	NMHDR hdr = new NMHDR ();	OS.MoveMemory (hdr, lParam, NMHDR.sizeof);	switch (hdr.code) {		case OS.RBN_CHILDSIZE:			/*			* Bug in Windows.  When Windows sets the size of the rebar band			* child and the child is a combo box, the size of the drop down			* portion of the combo box is resized to zero.  The fix is to set			* the size of the control to the current size after the rebar has			* already resized it.  If the control is not a combo, this does			* nothing.  If the control is a combo, the drop down portion is			* recalculated.			*/			NMREBARCHILDSIZE lprbcs  = new NMREBARCHILDSIZE ();			OS.MoveMemory (lprbcs, lParam, NMREBARCHILDSIZE.sizeof);			if (lprbcs.uBand != -1) {				CoolItem item = items [lprbcs.wID];				Control control = item.control;				if (control != null) {					int width = lprbcs.rcChild_right - lprbcs.rcChild_left;					int height = lprbcs.rcChild_bottom - lprbcs.rcChild_top;					control.setBounds (lprbcs.rcChild_left, lprbcs.rcChild_top, width, height);				}			}			break;		case OS.RBN_HEIGHTCHANGE:			if (!ignoreResize) {				Point size = getSize ();				int border = getBorderWidth ();				int height = OS.SendMessage (handle, OS.RB_GETBARHEIGHT, 0, 0);				setSize (size.x, height + (border * 2));			}			break;		case OS.RBN_CHEVRONPUSHED:			NMREBARCHEVRON lpnm = new NMREBARCHEVRON ();			OS.MoveMemory (lpnm, lParam, NMREBARCHEVRON.sizeof);			CoolItem item = items [lpnm.wID];			if (item != null) {				Event event = new Event();				event.detail = SWT.ARROW;				event.x = lpnm.left;				event.y = lpnm.bottom;				item.postEvent (SWT.Selection, event);			}			break;		case OS.NM_CUSTOMDRAW:			/*			* Bug in Windows.  On versions of Windows prior to XP,			* drawing the background color in NM_CUSTOMDRAW erases			* the separators.  The fix is to draw the background			* in WM_ERASEBKGND.			*/			if (OS.COMCTL32_MAJOR < 6) break;			if (background != -1 || (style & SWT.FLAT) != 0) {				NMCUSTOMDRAW nmcd = new NMCUSTOMDRAW ();				OS.MoveMemory (nmcd, lParam, NMCUSTOMDRAW.sizeof);				switch (nmcd.dwDrawStage) {					case OS.CDDS_PREERASE:						return new LRESULT (OS.CDRF_NOTIFYPOSTERASE);					case OS.CDDS_POSTERASE:						drawBackground (nmcd.hdc);						break;				}			}			break;	}	return super.wmNotifyChild (wParam, lParam);}