This is what Ive been doing with comp as well. I am making x, I wouldn't be happy with less than x, or I like my role and I wouldnt move unless I get y. Recruiters will usually be pretty open back and it saves a lot of time on both sides.
By asking these questions up front you might weed yourself out even though the role might have been a good match.
Especially if you make X and they reply with X - 20% (or worse).
Plus we don't work for glory and smiles. A while ago I always made it clear during interviews that I don't enjoy the money negotiations -- of course, that has been used against me so I learned to keep my wits about myself, and nowadays I am like "sure we like each other but I still would not work if I had my needs covered so what are you paying?" (obviously not asked in that form, of course).