Recruiters are easy: "What is the client's targeted range for this position?" or "What have you placed other people for at this company?"
If the top-end of the range is within some arbitrary percentage of your target, pursue, otherwise: "no thanks!"
"In-house recruiters" would require that kind of short-circuiting, and it will be met with varying results.
Asking: "what is the top end of your current employees' salary range for X role/experience?" can be good, too, to preempt the conversation.
It's not asking them to make an offer or anchor a price for you specifically, but will save everyone time when you discover that the top-end is 40% lower than you would even interview for.
If the prospective team is large and diverse enough, there will exist people that are more experienced and more-compensated than you. At that point you will at least know that they're paying it to someone.
If they're not paying anyone what you expect: you do not want to be the most well-compensated or smartest person in a role at a company and should pass on general principles.
First, I was a bit shocked to hear that Fortune 500 companies with $USD revenue in the billions would hire senior managers and want to pay them what would be considered an entry level salary for a good programmer right out of university, but honestly, I've defaulted to just telling them my salary because I want to avoid all the time wasting that multiple interviews would require, just to get to the point where they really like me, and would I please consider their great position where I'd have more responsibilities, longer hours, at half the salary...