HBRUSH      hBrush; HBRUSH      hBrushClear;
HBRUSH      hBrush      = NULL; HBRUSH      hBrushClear = NULL;
DrawBarberBar(HWND hWnd, int nBars){  int         i;	PAINTSTRUCT	ps;	HDC         hDC;	RECT        rect;	HBRUSH      hBrush;	HBRUSH      hBrushClear;  hDC = BeginPaint(hWnd, &ps);	GetClientRect(hWnd, &rect);  if(nBars <= 0)  {    /* clear the bars */    hBrushClear = CreateSolidBrush(GetSysColor(COLOR_MENU));    FillRect(hDC, &rect, hBrushClear);  }  else  {  	// Draw the bars    hBrushClear   = CreateSolidBrush(GetSysColor(COLOR_MENU));    hBrush        = CreateSolidBrush(RGB(0, 0, 128));	  rect.left     = rect.top = BAR_MARGIN;	  rect.bottom  -= BAR_MARGIN;	  rect.right    = rect.left + BAR_WIDTH;	  for(i = 0; i < (nBars + 1); i++)    {		  RECT	dest;		  if(IntersectRect(&dest, &ps.rcPaint, &rect))      {        if((i >= (nBars - 15)) && (i < nBars))			    FillRect(hDC, &rect, hBrush);        else			    FillRect(hDC, &rect, hBrushClear);      }      OffsetRect(&rect, BAR_WIDTH + BAR_SPACING, 0);	  }  }	DeleteObject(hBrushClear);	DeleteObject(hBrush);	EndPaint(hWnd, &ps);}