Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Getpixel and push button.
Hi. I'm trying to make a program that will push a virtual button if a certain pixel has a certain color.
The problem I got is that it only works sometimes. Is it because my function is too slow or why does this happend? Really annoying.
Check out my code:
using namespace std;
int _tmain(int argc, _TCHAR* argv)
BYTE redValue = 0;
HDC hDDC = GetDC( GetDesktopWindow() );
HDC hCDC = CreateCompatibleDC(hDDC);
HBITMAP hBitmap = CreateCompatibleBitmap(hDDC, 1600, 1200);
BitBlt(hCDC, 949, 794, 2, 2, hDDC, 949, 794, SRCCOPY|CAPTUREBLT);
0 · ·