IEventTrigger::get_Subscription method (taskschd.h)

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

This property is read/write.

Syntax

HRESULT get_Subscription(
  BSTR *pQuery
);

Parameters

pQuery

Return value

None

Remarks

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

For more information about writing a query string for certain events, see Event Selection and Subscribing to Events.

Examples

The following query string defines a subscription to all level 2 events in the System channel.

"<QueryList>
    <Query Id='1'>
        <Select Path='System'>*[System/Level=2]</Select>
    </Query>
</QueryList>"

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
Library Taskschd.lib
DLL Taskschd.dll

See also

IEventTrigger

Task Scheduler