HDC monitorDC = (CreateDC(displayDevices[0].DeviceName, displayDevices[0].DeviceName, NULL, NULL));
i = 0;
while (i < 1200)
{
std::cout << (INT)GetRValue(GetPixel(monitorDC, i, i)) << " " << (INT)GetGValue(GetPixel(monitorDC, i, i)) << " " << (INT)GetBValue(GetPixel(monitorDC, i, i)) << " " << std::endl;
i++;
}
This is just to test that it has accessed the first monitor and the handle is valid. When I tested this and anything moved, such as the console, I could see real-time results (So HDC is good).
The CALLBACK returns false. Even though it **appears** that the HDC is valid and stating the MSDN:
Enumerates all display monitors that intersect the visible region of the device context. **The callback function receives a handle to a DC for the specific display monitor.** but the BOOL always returns false using the above code.