IEventTrigger interface (taskschd.h)

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

Inheritance

The IEventTrigger interface inherits from the ITrigger interface.

Methods

The IEventTrigger interface has these methods.

 
IEventTrigger::get_Delay

Gets or sets a value that indicates the amount of time between when the event occurs and when the task is started. (Get)
IEventTrigger::get_Subscription

Gets or sets a query string that identifies the event that fires the trigger. (Get)
IEventTrigger::get_ValueQueries

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. (Get)
IEventTrigger::put_Delay

Gets or sets a value that indicates the amount of time between when the event occurs and when the task is started. (Put)
IEventTrigger::put_Subscription

Gets or sets a query string that identifies the event that fires the trigger. (Put)
IEventTrigger::put_ValueQueries

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. (Put)

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

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header taskschd.h

See also

IRepetitionPattern

IShowMessageAction

ITaskNamedValueCollection

ITrigger

TASK_TRIGGER_TYPE2

Task Scheduler

Task Scheduler Interfaces