John looks sunburnt. You ask: Have you been sitting in the sun?
You have just arrived to meet a friend who is waiting for you.
You ask: Have you been waiting long?
You meet a friend in the street. His face and hands are very dirty. You ask: What have you been doing?