GetDC(NULL) 取得螢幕 DCGetCursorPos + GetPixel 取得滑鼠下像素色值GetRValue/GetGValue/GetBValue 分解 RGB
HDC hDC = ::GetDC(NULL); // 1. 螢幕 DC
CPoint pt; GetCursorPos(&pt); // 2. 滑鼠座標
COLORREF clr = ::GetPixel(hDC, pt.x, pt.y);
CString str;
str.Format("R=%d", GetRValue(clr)); // 3. 分解顏色
str.Format("G=%d", GetGValue(clr));
str.Format("B=%d", GetBValue(clr));
::ReleaseDC(NULL, hDC); // 釋放 DC
#RRGGBB 格式