'To run this example, copy it to the ThisTerminal code window
Private Function Terminal_Connecting(ByVal sender As Variant, ByVal ConnectionID As Long, ByVal connnectionType As Attachmate_Reflection_Objects_Emulation_OpenSystems.ConnectionTypeOption, ByVal connectionSettings As Variant) As Boolean
Dim msg As String 'the message to include in the dialog box
'Get the connection type and include it in the message
Select Case connectionType
Case ConnectionTypeOption_None
msg = "There is no connection currently configured. Do you want to connect?"
Case ConnectionTypeOption_BestNetwork
msg = "The connection type is " & "BestNetwork? " & "Do you want to connect?"
Case ConnectionTypeOption.ConnectionTypeOption_SecureShell
msg = "The connection type is " & "SecureShell? " & "Do you want to connect?"
Case ConnectionTypeOption.ConnectionTypeOption_Telnet
msg = "The connection type is " & "Telnet? " & "Do you want to connect?"
Case ConnectionTypeOption.ConnectionTypeOption_VT_MGR
msg = "The connection type is " & "VT_MGR. " & "Do you want to connect?"
Case Else
msg = "Do you want to connect?"
End Select
'Display a message box and get the user response
confirm = MsgBox(msg, vbYesNo)
'Depending on the response, allow or disallow connecting
If confirm = vbYes Then
Terminal_Connecting = True
Else
Terminal_Connecting = False
End If
End Function