I remember looking at this in the source one time. I think you would have to look somewhere similar to the crosshair pick. I could be wrong, so if anyone has any ideas, correctly me if you like.
ZCombatInterface::OnSetPickTarget
If I recall on the crosshair, it is related to what you were asking for. You could of simply look it up yourself with the word in the source, 'pick' which is related to the crosshair.