rbBand.fMask = OS.RBBIM_SIZE; rbBand.cx = MAX_WIDTH; OS.SendMessage (handle, OS.RB_SETBANDINFO, lastIndex - 1, rbBand);
rbBand.fMask = OS.RBBIM_STYLE; OS.SendMessage (handle, OS.RB_GETBANDINFO, index, rbBand); if ((rbBand.fStyle & OS.RBBS_BREAK) != 0) { resizeToPreferredWidth (index - 1); }
void destroyItem (CoolItem item) {	int index = OS.SendMessage (handle, OS.RB_IDTOINDEX, item.id, 0);		/*	* Feature in Windows.  When the last item in a row is removed,	* Windows sometimes moves items to the right side of the cool	* bar.  The fix is to resize the next to last item to be the	* maximum size.	*/	int count = OS.SendMessage (handle, OS.RB_GETBANDCOUNT, 0, 0);	if (count != 0) {		int lastIndex = getLastIndexOfRow (index);		if (index == lastIndex) {			REBARBANDINFO rbBand = new REBARBANDINFO ();			rbBand.cbSize = REBARBANDINFO.sizeof;			rbBand.fMask = OS.RBBIM_SIZE;						rbBand.cx = MAX_WIDTH;			OS.SendMessage (handle, OS.RB_SETBANDINFO, lastIndex - 1, rbBand);		}								}				/*	* Feature in Windows.  When Windows removed a rebar	* band, it makes the band child invisible.  The fix	* is to show the child.	*/			Control control = item.control;	boolean wasWrap = item.getWrap ();	boolean wasVisible = control != null && !control.isDisposed() && control.getVisible ();	if (OS.SendMessage (handle, OS.RB_DELETEBAND, index, 0) == 0) {		error (SWT.ERROR_ITEM_NOT_REMOVED);	}	items [item.id] = null;	item.id = -1;	index = 0;	while (index < originalItems.length) {		if (originalItems [index] == item) break;		index++;	}	int length = originalItems.length - 1;	CoolItem [] newOriginals = new CoolItem [length];	System.arraycopy (originalItems, 0, newOriginals, 0, index);	System.arraycopy (originalItems, index + 1, newOriginals, index, length - index);	originalItems = newOriginals;	if (wasWrap) {		if (0 <= index && index < getItemCount ()) {			getItem (index).setWrap (true);		}	}	if (wasVisible) control.setVisible (true);}