Programming with Reflection

image\msref32.gif Wait and Event Keywords

 

Reflection's event-handling methods and properties allow you to associate actions with events that can happen during a Reflection session. Reflection's API includes several ways of managing events.

This topic describes and lists events in the following four categories:

· Automation events

· OnEvent methods

· DefineEvent methods and properties

· Wait commands

Automation Events

Automation events are a standard part of OLE Automation APIs. Events of this type are part of an application's object library and are identified in the Visual Basic Editor Object Browser with a lighting bolt icon.

image\jump.gif BeforeExit event

image\jump.gif BeforeTerminalKey event

image\jump.gif BeforeTransmitString event

image\jump.gif DefinedEvent event

OnEvent Commands

Commands in this group are equivalent to using Reflection's Event Setup dialog box. For example, you can add items to Reflection's Event Setup dialog box using the OnEvent method, and delete items using the RemoveOnEvent method. Changes you make to Reflection using these commands can be saved to your settings file.

image\jump.gif EnableOnEvent method

image\jump.gif OnEvent method

image\jump.gif RemoveOnEvent method

DefineEvent Commands

Commands in this group are defined using the DefineEvent method. This method defines an event without associating a specific action with that event. You can use subsequent commands to check for the occurrence of a defined event, or to wait for a defined event to happen. Commands in this group have no effect on the Event Setup dialog box; and events you define using the following methods are not saved as part of your settings file; with each new Reflection session, you must run the macro in order to define the event. (The value of the KeysDuringWait property is saved with your settings.)

image\jump.gif CheckEvent method

image\jump.gif CheckEventNumber method

image\jump.gif ClearEvents method

image\jump.gif DefineEvent method

image\jump.gif RemoveEvent method

image\jump.gif ResetEvent method

image\jump.gif WaitEvent method

image\jump.gif WaitEventNumber method

image\jump.gif WaitForEvent method

image\jump.gif EventDefined property

image\jump.gif KeysDuringWait property

Wait Commands

Commands in this group wait for an event that is defined as part of the command. These commands have no effect on the Event Setup dialog box; and events you define with these methods are not saved as part of your settings file. (The value of the KeysDuringWait property is saved with your settings.)

image\jump.gif Wait method

image\jump.gif WaitForCommString method

image\jump.gif WaitForDisplayString method

image\jump.gif WaitForPrinterStatusString method

image\jump.gif WaitForPrinterString method

image\jump.gif WaitForPrinterStringReplace method

image\jump.gif WaitForTerminalKey method

image\jump.gif WaitForTimeOfDay method

image\jump.gif KeysDuringWait property