レスありがとうございます
GetPixcelでやって見ようと思うんですが
RGBの値をうまく取得できません。すべて255,255,255になってしまいます。
下のようにやったのですが、何がいけないのでしょうか?

COLORREF color;

hdc=BeginPaint(hWnd,&ps);
color=RGB(0,0,255);
SetPixel(hdc,10,10,color);
int r=GetRValue(GetPixel(hdc,10,0));
int g=GetGValue(GetPixel(hdc,10,0));
int b=GetBValue(GetPixel(hdc,10,0));
wsprintf(buff,TEXT("%d %d %d"),r,g,b);
MessageBox(NULL,LPWSTR(buff),NULL,MB_OK);