Desktop ID


I need to be able to identify unique desktops.

I have a windows service and it is independant of any desktop and there are application that are making calls to this service via remoting. I need to be able to file these calls, each call can come from a specific machine, username and desktop, and I need to be able to retrieve that information somehow.

I use Environment.Username and Environment.MachineName for first 2 parameters, but i can't get the Desktop ID...

I tried using GetProcessWindowStation in user32.dll but it doesn't return unique id when I login to the same workstation with the same username, this GetProcessWindowStation function returns the same number... thus I cannot differentiate between desktops.

Can someone please help me... I spend hours and hours searching the internet and I can't find anything
Who is Participating?
Hi RodionP,

this is a example very good. It has some methodsfor your problem:

Good luck,
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.