thank you for your reply but it's not what im looking for, GetComputerName() is used to get the computer name of the current system

What Im looking for is how to get the computer name of a user where he is logged in.

example is if a user would send message to "USER1" the system must determine first on what computer is "USER1" logged in so I can user the computer name on the mailslot \\"computername"\mailslot\messngr.

what I want to achieve is to :
Determine on what computer a user is logged in on a network environment.

Thanks, I appreciate your help.