I need to find the color of any/all pixel/s on the screen. The code I got so far seems to do that but it doesn't get the pixel of my game window (another program, direct draw window app).
Here is the code...
The idea of the program is to place the cursor over some color and the program will show you the values for that color.
HDC hdc = GetDC(0);
COLORREF pixel = GetPixel(hdc, pt.x, pt.y);
cout << " red: " << (int)GetRValue(pixel)
<< " green: " << (int)GetGValue(pixel)
<< " blue : " << (int)GetBValue(pixel) << '\n';