why GetPixel returns a little bit different values
#include <stdio.h> #include <Windows.h> #include <WinUser.h> int main() { SetProcessDPIAware(); HDC monitor = GetDC(NULL); POINT cursor; COLORREF color; while (TRUE) { if (!GetCursorPos(&cursor)) { puts(“GetCursorPosError!”); exit(EXIT_FAILURE); } color = GetPixel(monitor, cursor.x, cursor.y); if (GetRValue(color) == 75 && GetGValue(color) == 219 && GetBValue(color) == 106) { mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0); mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); […]
Windows programming(take a shot of an application)
I want to take a shot of an application, it’s an other application,not the running application.