to colour the items of your dialog like static control, group box etc you dont need its rectangle coordinates. you can get it done in your OnCtlColor() function of your dialog. There you just need to check the control item id and assign text and background colour like this
if( IDC_GROUP1 == pWnd->GetDlgCtrlID())
{
pDC->SetTextColor(RGB(255,0,0));
pDC->SetBkColor(RGB(0,0,255));
}
where IDC_GROUP1 is the id of your group box.
but in this way you will not be able to colour the frame of your group box.
for this create a your own class derived from CStatic, say CMyStatic.
then you need to create a control member variable of your gruop box item. its class type should be CMyStatic.
and within CMyStatic OnPaint() you need to do all things to draw a group box frame using FrameRect() call.
also you need to write the code to draw group box text.you can modify the below code accordingly to get what you need.
void CMyStatic::OnPaint()
{
CPaintDC dc(this);
CRect WndRect;
CBrush GreenBrush;
GreenBrush.CreateSolidBrush(RGB(0,255,0));
dc.GetWindow()->GetClientRect( WndRect );
dc.FrameRect( WndRect, &GreenBrush );
dc.SetTextColor(RGB(0,255,0));
dc.SetBkColor(RGB(255,0,0));
dc.TextOut(WndRect.left + 5,WndRect.top - 10,"Title" );
}