I know the format of the result, but I would like to know how I can easily split the red/green/blue values.
MSDN say to use GetRValue, GetGValue, and GetBValue. But we don't have those yet.
Since the COLORREF is of hex format 0x00bbggrr there should be a simple way to get only the part you want, no ??
Ye, I'm a C noob I admit it.. Any help would be cool. Thanks
- Code: Select all
VOID wheredoiclick() {
long clickedX;
long clickedY;
POINT clickedhere;
PrintF("You have 5 seconds to position the mouse before I tell you the X/Y location.");
Sleep(5000);
GetCursorPos(&clickedhere);
PrintF("You clicked X: %u and Y: %u", clickedhere.x, clickedhere.y);
PrintF("move_mouse(%u,%u);", clickedhere.x, clickedhere.y);
// Some colour routines
char * ttwindowname = "some game";
Foreground_window( ttwindowname );
HWND hTST = FindWindow( ttwindowname );
if ( !hTST ) { return; }
HDC something = GetWindowDC( hTST);
int colors = GetPixel( something, clickedhere.x, clickedhere.y);
PrintF("Colour index of that pices is %u.", colors);
ReleaseDC( hTST, something);
}