This happens to me ALL THE TIME! I've learned to just say, "Excuse me, but I came here to talk with my friend. I'm not interested in talking with you. Sorry." Guys get SO FREAKED OUT when I call them out on it, but what can I say? I'm direct. It's funny to watch his face register that he's just been publicly shot down. Them's the breaks, buddy.
So I'm sitting at a bar, having a beer and a heart-to-heart with my best girlfriend. I've noticed you, because you've been sitting directly behind my friend and staring at me conspicuously for the past thirty minutes. I've politely disregarded your passive-aggressive advances by refusing to maintain eye contact with you for more than a second, making it quite obvious that I am more interested in talking to my friend than flirting with you.
Guys, this is Harry Potter's butt
Therefore, I am not going to respond warmly when you suddenly interrupt my friend in the middle of her sentence with some stupid line like, "So, are you students?" and "What are you guys studying?"
If you had been studying--my body language, that is--or listening while you were staring at me like a sad, hungry puppy, you would have noticed that my friend and I were engaged in a meaningful and personal conversation. You may have also noticed that it mostly involved the subject of our current boyfriends, and how much we adore them.
In that case, we probably wouldn't have been interested in talking to you anyway. But, if you've learned anything from your mother, or your third-grade teacher, or even the friends that you came here with, it's just plain rude and inappropriate to butt into a conversation, unless you're planning on offering us another round of drinks, or dying to tell us how incredibly beautiful we are before you leave and go somewhere else. If you're not doing either of those things, then please, butt out.
You can't see me, but I'm blowing at the tops of my fingertips like they're freshly fired guns. Now, I just pretended to put them in an imaginary holster at my hips. Now, I just winked. Now, I just said, "Mess with the best, die like the rest." Not out loud; in my head. I'm basically an imaginary cowboy that quotes Hackers. That sums it up.