GefApplication.TSSessionID (read-only property)

Gets the Terminal Services session ID for this application.
Syntax: long = object.TSSessionID
Description: Ordinarily, this property returns 0. However, for Terminal Services clients, CimView return a non-zero session ID to indicate that it is running in a Terminal Services session.

This property allows you to retrieve the session ID associated with a Terminal Services client session. Use this property if you need to check if a CimView instance is acting as a Terminal Services client, or if you need to track or check whether a given CimView instance belongs to the same "session" as another, and therefore represents the same client.


Sub Application_TSSessionID()
    Dim oCimApp As GefApplication
    Set oCimApp = CimGetScreen.Application
    Select Case oCimApp.TSSessionID
        Case 0
            MsgBox "The screen is not in a Terminal Services session."
        Case Is <> 0
            MsgBox "The screen is in a Terminal Services session."
    End Select
End Sub