COLORREF color=RGB(0,255,0);
unsigned char r=GetRValue(color);
unsigned char g=GetGValue(color);
unsigned char b=GetBValue(color);
-------------------------------------
CColorDialog colorDialog;
COLORREF color;if( colorDialog.DoModal() == IDOK ){ color = colorDialog.GetColor();}-------------------------------------
((CMFCColorButton*)GetDlgItem(IDC_MFCCOLORBUTTON1))->SetColor(RGB(204,204,204));
COLORREF color=((CMFCColorButton*)GetDlgItem(IDC_MFCCOLORBUTTON1))->GetColor();