i did some debugging and made a separate program
Code:
int main()
{
HDC hdcScrn;
COLORREF array1[100][100];
Sleep(2000);
hdcScrn=CreateDC("DISPLAY",0,0,0);
for (INT col = 1; col < 50; col += 1)
{
for (INT row = 1; row < 50; row += 1)
{
COLORREF pixColor = GetPixel(hdcScrn,col,row);
array1[row][col] = pixColor;
cout << row << " ";
cout << col << " ";
cout << array1[row][col] << endl;
Sleep(10);
}
}
DeleteDC(hdcScrn);
system("pause");
return 0;
}
it works. if you are going to run it on your computer i'd change the loop to 20 instead of 50 b/c it takes a while.
when i change the loop values to my original program and declare the array to be bigger it exits just like before.