Ok, I understand this now.
I created my own class derived from CProgressCtrl and override the OnPaint command.
void CMyProgress::OnPaint()
{
CPaintDC dc(this);
CRect clientRect ;
CRect windowRect;
GetWindowRect(windowRect);
windowRect.SetRect(0, 0, windowRect.Width(), windowRect.Height());
GetClientRect(clientRect);
clientRect.SetRect(1, 1, windowRect.Width() + 1, windowRect.Height() + 1);
dc.Draw3dRect(windowRect, GetSysColor(COLOR_3DSHADOW), GetSysColor(COLOR_3DLIGHT));
CRect barRect = clientRect;
if(! GetStyle() && PBS_VERTICAL)
{
int rangeLow, rangeHigh;
GetRange(rangeLow, rangeHigh);
int x = GetPos(), y;
if(x < rangeLow || x > rangeHigh)
return;
x -= rangeLow;
x *= 100;
x /= (rangeHigh - rangeLow);
y = clientRect.Width();
y *= x;
y /= 100;
y += clientRect.left;
barRect.right = barRect.left + y;
}
else
{
int rangeLow, rangeHigh;
GetRange(rangeLow, rangeHigh);
int y = GetPos(), x;
if(y < rangeLow || y > rangeHigh)
return;
y -= rangeLow;
y *= 100;
y /= (rangeHigh - rangeLow);
x = clientRect.Height();
x *= y;
x /= 100;
x += clientRect.top;
barRect.top = barRect.bottom - x;
}
CBrush brush;
brush.CreateSolidBrush(m_BarColour);
dc.FillRect(barRect, &brush);
}