Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
ITriggerCollection::Create method (taskschd.h)
Creates a new trigger for the task.
Syntax
HRESULT Create(
[in] TASK_TRIGGER_TYPE2 type,
[out] ITrigger **ppTrigger
);
Parameters
[in] type
This parameter is set to one of the following TASK_TRIGGER_TYPE2 enumeration constants.
| Value | Meaning |
|---|---|
|
Triggers the task when a specific event occurs. |
|
Triggers the task at a specific time of day. |
|
Triggers the task on a daily schedule. For example, the task starts at a specific time every day, every-other day, every third day, and so on. |
|
Triggers the task on a weekly schedule. For example, the task starts at 8:00 AM on a specific day every week or other week. |
|
Triggers the task on a monthly schedule. For example, the task starts on specific days of specific months. |
|
Triggers the task on a monthly day-of-week schedule. For example, the task starts on a specific days of the week, weeks of the month, and months of the year. |
|
Triggers the task when the computer goes into an idle state. |
|
Triggers the task when the task is registered. |
|
Triggers the task when the computer boots. |
|
Triggers the task when a specific user logs on. |
|
Triggers the task when a specific session state changes. |
[out] ppTrigger
An ITrigger interface that represents the new trigger.
Pass in a reference to a NULL ITrigger interface pointer. Referencing a non-NULL pointer can cause a memory leak because the pointer will be overwritten.
Return value
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
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
Feedback
Was this page helpful?
