IScheduledWorkItem::CreateTrigger method (mstask.h)
[[This API may be altered or unavailable in subsequent versions of the operating system or product. Please use the Task Scheduler 2.0 Interfaces instead.] ]
Creates a trigger for the work item.
HRESULT CreateTrigger( [out] WORD *piNewTrigger, [out] ITaskTrigger **ppTrigger );
A pointer to the returned trigger index value of the new trigger. The trigger index for the first trigger associated with a work item is "0". See Remarks for other uses of the trigger index.
The CreateTrigger method returns one of the following values.
||The operation was successful.|
||The arguments are not valid.|
||Not enough memory is available.|
You use the trigger index returned by piNewTrigger when you are either retrieving or deleting triggers. However, the trigger index is not an identifier. It indicates only the new trigger's position relative to the other current triggers associated with the work item.
To set the criteria for the new trigger, call ITaskTrigger::SetTrigger.
After creating a new trigger for a work item, applications must call the IPersistFile::Save method to save the new trigger to disk.
For an example of how to set the trigger criteria when creating a new trigger, see Creating a New Trigger.
|Minimum supported client||Windows 2000 Professional [desktop apps only]|
|Minimum supported server||Windows 2000 Server [desktop apps only]|
|Redistributable||Internet Explorer 4.0 or later on Windows NT 4.0 and Windows 95|