Thanks a lot. I will do it with your first approach. The whole thing is based on the need to make an app work in a Terminal Services environmnent. It's something strange, I got a telnet session on a foreign OS. From there I launch a command like RunWord. The process of this command retrieves through native API's the IP adress and client port number of the telnet session . These parameters are sent to a service on the Terminal Server, that now has to decide on what Session to open Word. So one approach is to search for the PID of the open port, to get from this PID the SessionID and to launch Word in this Session. All I need is a roadmap and then I might be able to find a clue.