In Harry Potter and the Goblet of Fire we are introduced to Moody. He has an assortment of Dark Detectors. One of these dark detectors is the "Foe-Glass". How does the Foe-Glass choose whose foes to display? Harry visits Moody before the first task and Moody says "See them out there, skulking around? I'm not really in trouble until I see the whites of their eyes". This implies that the Foe-Glass is currently reflecting Moody's foes - not Harry's - so it doesn't just display the foes of those that look into the glass. This makes sense if the Foe-Glass belongs to Moody.
However, (GoF spoilers)
The person that is pretending to Professor Moody is actually Barty Crouch Jr. He even states that the dark detectors were stolen from the real Moody so this implies that the Foe-Glass was actually the real Moody's. Why would it then seem to display the foes of Barty Crouch instead of Moody? Does it somehow 'know' that the impostor currently possesses it - similar to how the elder wand 'knows' who its rightful owner is?
How does the Foe-Glass decide whose foes to display?