Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Emulation.OpenSystems Library / Attachmate.Reflection.Objects.Emulation.OpenSystems Library / DefinedEventHandler Event
The event identifier. This corresponds to the DefineEvent return value.
The type of event fired.as defined by a DefinedEventType Enumeration.
When pertinent, the string value associated with the event.
When pertinent, the screen row associated with the event.
When pertinent, the screen column associated with the event.
ExampleExample
In This Topic
DefinedEventHandler Event
In This Topic
This event is triggered when an event defined by the DefineEvent method occurs. Events defined in this way remain defined as long as your Reflection session lasts, or until they are removed using the RemoveEvent or ClearEvents methods.
Syntax
Public Delegate Sub DefinedEventHandler( _
   ByVal EventNumber As Integer, _
   ByVal EventType As DefinedEventType, _
   ByVal TheString As String, _
   ByVal Row As Integer, _
   ByVal Column As Integer _
) 

Parameters

EventNumber
The event identifier. This corresponds to the DefineEvent return value.
EventType
The type of event fired.as defined by a DefinedEventType Enumeration.
TheString
When pertinent, the string value associated with the event.
Row
When pertinent, the screen row associated with the event.
Column
When pertinent, the screen column associated with the event.
Example
This code sample defines an event to fire when there is no host activity for 30 seconds. It handles the event to disconnect the session
'Put this code in the ThisTerminal code window
Private Sub Terminal_Connected(ByVal sender As Variant, ByVal ConnectionID As Long, ByVal connnectionType As Attachmate_Reflection_Objects_Emulation_OpenSystems.ConnectionTypeOption, ByVal connectionSettings As Variant)
    
    'Define an event that occurs when there is no host activity for 30 seconds
    ThisScreen.DefineEvent 1, DefinedEventType_Silence, "00:00:30", 1, 1
    
End Sub
 
'Put this code in the ThisScreen code window
'The following procedure is executed when a defined event triggers.
Private Sub Screen_DefinedEvent(ByVal EventNumber As Long, ByVal EventType As Attachmate_Reflection_Objects_Emulation_OpenSystems.DefinedEventType, ByVal TheString As String, ByVal row As Long, ByVal column As Long)
     
     'If the host is inactive for the specified interval, disconnect
     If EventNumber = 1 Then
         ThisTerminal.Disconnect
     End If
     
 End Sub
See Also