Josh Assing, Jassing Consulting
Allows you to query the connection status (connected, disconnected, etc), Logoff the session, get the username, etc.
Small FLL (library) to help you, combined with a timer, you can check the status of the connection state, and if disconnected, you can close files, or log off the server for security purposes.
Updated dll to remove a few useless functions & add "client Address" function.
Zip File now includes Terminal Server DLL's so that on NON TS machines, you don't get "invalid library".
If you prefer an 'installer' to the zip files --
http://www.jassing.com/binaries/TSHelp.exe