You can prevent users from closing sessions until certain conditions are met.
If you prefer to run macros in pre-configured sessions instead of creating your own sessions, you can download the VBA Sample Sessions and open the close-sessions-gracefully.rdox (Open Systems) file. The download package contains everything you need to run the macros in this file. See Download the VBA Sample Sessions.
This sample requires users to close an application before they terminate the session.
This sample applies only to Open Systems terminals.
To run this sample
This macro handles the Closing event to check for a user exit command. If it finds the command in the display memory, the event is set to true and the application closes. If not, the event is cancelled, and the user is not allowed to close the session.