IEventTrigger interface

Represents a trigger that starts a task when a system event occurs.

Members

The IEventTrigger interface inherits from ITrigger. IEventTrigger also has these types of members:

Properties

The IEventTrigger interface has these properties.

PropertyAccess typeDescription

Delay

Read/write

Gets or sets a value that indicates the amount of time between when the event occurs and when the task is started.

Enabled

Read/write

Inherited from the ITrigger interface. Gets or sets a Boolean value that indicates whether the trigger is enabled.

EndBoundary

Read/write

Inherited from the ITrigger interface. Gets or sets the date and time when the trigger is deactivated. The trigger cannot start the task after it is deactivated.

ExecutionTimeLimit

Read/write

Inherited from the ITrigger interface. Gets or sets the maximum amount of time that the task launched by this trigger is allowed to run.

Id

Read/write

Inherited from the ITrigger interface. Gets or sets the identifier for the trigger.

Repetition

Read/write

Inherited from the ITrigger interface. Gets or sets how often the task is run and how long the repetition pattern is repeated after the task is started.

StartBoundary

Read/write

Inherited from the ITrigger interface. Gets or sets the date and time when the trigger is activated.

Subscription

Read/write

Gets or sets the XPath query string that identifies the event that fires the trigger.

Type

Read-only

Inherited from the ITrigger interface. Gets the type of the trigger.

ValueQueries

Read/write

Gets or sets a collection of named XPath queries. Each query in the collection is applied to the last matching event XML returned from the subscription query specified in the Subscription property. The name of the query can be used as a variable in the message of an IShowMessageAction action.

 

Remarks

A maximum of 500 tasks with event subscriptions can be created. An event subscription that queries for a variety of events can be used to trigger a task that uses the same action in response to the events being logged.

When reading or writing your own XML for a task, an event trigger is specified using the EventTrigger element of the Task Scheduler schema.

Examples

For more information and example code for this interface, see Event Trigger Example (C++).

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Taskschd.h

Library

Taskschd.lib

DLL

Taskschd.dll

See also

Task Scheduler Interfaces
Task Scheduler
ITaskNamedValueCollection
ITrigger
IRepetitionPattern
TASK_TRIGGER_TYPE2
IShowMessageAction

 

 

Show: