稍稍改了下
// palette
void palette(){
double x;
double y = 300;
double x1 = 400;
double x2 = 400;
COLORREF color;
HDC hDC = ::GetDC(NULL);
color = ::GetPixel(hDC, 400, 300);
if((GetBValue(color))<100){
while( (::GetPixel(hDC, x1, 300))<100){
x1++;
}
while( (::GetPixel(hDC, x2, 300))<100){
x2--;
}
x=(x1)/2+(x2)/2;
while((::GetPixel(hDC, x, y))){
y++;
}}
mouse_event(MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE, (x-1), (y-1), 0, 0);
return;
}
编译通过,运行直接报错(变量x未定义)