>I am trying to figure out how to get the IP address from the API under Terminal Services, and hoping that it shows the IP the client has connected to as the primary IP. I am hoping to be able to set up a loader that will load the proper program based on the IP that the terminal server session has connected to. Can this be done or do I have to setup a loader that asks them who they are?
It depend on how you connect to WTS - if you're using a VPN, the terminal session is assigned an internal subnet address for purposes of the VPN session - their 'real' IP address is immaterial. I'd suggesgt using information based on the user login ID for the WTS session rather than trying to winkle out an IP address ansd then alter HKLM based on the remote IP address.