#include <iostream>
#include <conio.h>
#include <Windows.h>
#include <string>
usingnamespace std;
int main() {
POINT p;
int x;
int y;
string red, green, blue;
while(0==0){
GetCursorPos(&p);
x = p.x;
y = p.y;
//[insert color detector here]
cout >> red >> green >> blue;
}
_getch();
}
The response from Athar is accurate. Why were you unable to follow it? Basically you use GetPixel() to obtain the color. But in order to call it, you need a device context (HDC). To get a DC you use GetDC().