1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
#include<windows.h>
#include<stdio.h>
#include <iostream>
using namespace std;
typedef WINAPI COLORREF (*GETPIXEL)(HDC, int, int);
int x=0, y=0;
int main(int argc, char** argv)
{
Sleep(2000);
HINSTANCE _hGDI = LoadLibrary("gdi32.dll");
if(_hGDI)
{
while(true) {
GETPIXEL pGetPixel = (GETPIXEL)GetProcAddress(_hGDI, "GetPixel");
HDC _hdc = GetDC(NULL);
if(_hdc)
{
POINT _cursor;
GetCursorPos(&_cursor);
COLORREF _color = (*pGetPixel) (_hdc, _cursor.x, _cursor.y);
int _green = GetGValue(_color);
int _blue = GetBValue(_color);
if(_green==151 && _blue==80){
Sleep(5);
mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0);
Sleep(40);
mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0);
Sleep(50);
}
}
FreeLibrary(_hGDI);
}
}
return 0;
}
|