HP Remote Graphics Software 5.4.0 User Guide

10 Remote Application Termination
This chapter describes how to create a Windows agent on the Sender that provides Remote Application
Termination. “Remote application” refers to user applications that are running on the Remote Computer
(Sender). The sample agent described in this chapter is designed to terminate applications on the
Sender when an RGS disconnect occurs.
10.1 RGS connection and user status
As described in Establishing an RGS connection using Standard Login on page 19, an RGS connection
normally require two authentication steps:
The first authentication step is from the RGS Receiver to the RGS Sender—this is called
authenticating the RGS connection. The dialog for this authentication step is generated and
displayed by the RGS Receiver on the Local Computer.
The second authentication step is when logging into or unlocking the Remote Computer desktop
session—this is called logging into the Remote Computer. The login or unlock dialog is generated
by the Remote Computer, and is displayed in the Remote Display Window on the Local Computer.
A desktop session can operate independently of the RGS connection. This allows a user to disconnect
and reconnect to desktop sessions as part of a normal workflow. However, when an RGS connection is
unintentionally disconnected, the user may require remote applications to be terminated to prevent them
from operating unsupervised.
The sample agent described in this chapter monitors the number of primary users connected to the
Remote Computer. When the number of primary users drops to zero, the agent terminates all
applications on the Remote Computer. To determine the number of primary users, the agent reads and
interprets the HPRemote log.
10.2 HPRemote log format
Data in the HPRemote log consists of a Message ID followed by optional data in both character string
and binary data formats. Binary data provides direct access to data without requiring application
parsing. Character strings format the binary data into human-readable messages compatible with the
Windows Event Viewer.
Table 10-1 RGS Sender events logged in the HPRemote log on page 186
shows the events logged in the HPRemote log. The Message IDs are defined in the header file
RGSenderEvents.h, and are 32-bit values. The EventID is from the Code field within the Message ID
and, for the HPRemote log, ranges from 1 to 13.
Table 10-1 RGS Sender events logged in the HPRemote log
Message ID Description
186 Chapter 10 Remote Application Termination ENWW