HDC hDC = ::GetDC(NULL);//lock paint DC
COLORREF colorref = ::GetPixel(hDC, point.x, point.y);//get the cursor color
CString Color_text;
red = GetRValue(colorref);//store red color
Color_text.Format("%d",red);
SetDlgItemText(IDC_RED,Color_text);//display the color value
green = GetGValue(colorref);//store green color
Color_text.Format("%d",green);
SetDlgItemText(IDC_GREEN,Color_text);//display the color value
blue = GetBValue(colorref);//store blue color
Color_text.Format("%d",blue);
SetDlgItemText(IDC_BLUE,Color_text);//display the color value