How an application can detect that it is running as a RemoteApp?
RemoteApp sessions are started on the terminal server by RDPINIT.EXE
. So the application can check if RDPINIT.EXE is the parent process.
Details:
An instance of RDPINIT.EXE runs on the Terminal Server for each users RemoteApp session. RDPINIT.EXE is loaded by USERINIT.EXE as a RemoteApp specific implementation of USERINIT.EXE. RDPINIT.EXE acts as a watchdog to launch RDPSHELL.EXE and monitor process startup and shutdown. RDPSHELL.EXE is the shell that is used instead of EXPLORER.EXE to provide RemoteApp functionality. RDPINIT.EXE monitors the process lifecycle of RDPSHELL.EXE and restarts it in the event that it abnormally terminates. RDPSHELL.EXE loads a set of Windows event hooks onto each user desktop in the session. These event hooks allow RDPSHELL.EXE to monitor the state of all windows on the desktop. ...
(quoted from Technet)