Damn, it's not working for me either. GetPixel keeps returning -1 (0xFFFFFFFF). Not sure why, I can't find a good explanation anywhere..
I'll keep looking into this.
I'll keep looking into this.
HDC hdc = GetDC(0);
for(int x=0;x<GetSystemMetrics(SM_SCREENX);x++)
{
for(int y=0;y<GetSystemMetrics(SM_SCREENY);y++)
{
if(GetPixel(hdc, x, y) == COLORREF(255, 0, 0)) MessageBox(0, L"TROLL", L"TROLL", MK_OK);
}
}
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
int x;
int y;
HWND hwnd = GetDesktopWindow();
HDC hdc = GetDC(hwnd);
COLORREF rgb;
COLORREF red;
COLORREF green;
COLORREF blue;
while(true)
{
for(x = 0; x<GetSystemMetrics(SM_CXSCREEN); x++)
{
for(y = 0; y<GetSystemMetrics(SM_CYSCREEN); y++)
{
rgb = GetPixel(hdc, x, y);
red = GetRValue(rgb);
green = GetGValue(rgb);
blue = GetBValue(rgb);
if(red==0 && green==127 && blue==252){SetCursorPos(x,y);}
if(GetAsyncKeyState(VK_SHIFT)&1){return 0;}
}
}
}
}
for(int x = 0; x < 1200; x++){
for(int y = 0; y< 1200; y++){
int cx,cy;
cx = GetSystemMetrics(SM_CXSCREEN);
cy = GetSystemMetrics(SM_CYSCREEN);
for(int x = 0; x<cx; x++){
for(int y = 0; y<cy; y++){