Hello, I am trying to use the GetPixel function in my program. I tried just including <windows.h> but I still couldent use the function. So this is my code:
int main()
{
FARPROC fGetPixel;
HINSTANCE gdi32 = LoadLibrary("gdi32.dll");
if(gdi32)
{
fGetPixel = GetProcAddress(gdi32, "GetPixel");
HDC device = GetDC(NULL);
if(device)
{
COLORREF colour = (*fGetPixel) (device, 0, 0);
int red = GetRValue(colour);
int green = GetGValue(colour);
int blue = GetBValue(colour);
cout << "Red: " << red << endl;
cout << "Green: " << green << endl;
cout << "Blue: " << blue << endl;
}
FreeLibrary(gdi32);
}
return 0;
}
But when I try to run it, I get this error:error: too many arguments to function (I am using Code::Blocks) I have looked up the function on msdn, and it definatly takes three parameters, so I cant figure out why this is happening. If anyone could help me I would be very greatful, thankyou.