Here's my script need help with the courser.
Hay guys I need some help with this. Ok I have made a simple color picker for the CMD. It gets the color of the pixel from were the mouse pointer is.
This is what I’m trying to get to happen.
When the script runs I wont it to wait for the mouse to click before it gets the color of the pixel from the mouse pointer
This is what is does so far.
When it runs it automatically gets the pixel from the mouse position with out waiting for a click.
So can any of you help me with this??
Code:
#include <iostream>
#include <stdlib.h>
#include <windows.h>
int main()
{
POINT pt;
GetCursorPos(&pt);
cout << pt.x << endl;
cout << pt.y;
HDC hdc = GetDC(NULL);
DWORD color = GetPixel(hdc, pt.x, pt.y);
unsigned int r = GetRValue(color);
unsigned int g = GetGValue(color);
unsigned int b = GetBValue(color);
cout << "red: " << r << endl;
cout << "green: " << g << endl;
cout << "blue: " << b << endl;
cin.get();
cin.ignore();
return 0;
}
O yes and I’m using Dev-C++ and Windows XP.