You don't have to call WhenProgress. Your fx() function IS the WhenProgress callback:
bool fx(int a,int b){ <- Gate variants should return boolean value, not integer.
float f= static_cast<double>(a) / b * 100;
Cout() <<"avaliando " << a << " " << b << " % " << Format("%.1f%%", f ) << EOL;
return boolean_condition; // <---- boolean_condition is up to you to define. If it is true, it will stop progressing. If false (default) it will continue the progress.
}