TASK_TRIGGERTASK_TRIGGER*
*Contents  *Index  *Topic Contents
*Previous Topic: MONTHLYDOW
*Next Topic: WEEKLY

TASK_TRIGGER

typedef struct _TASK_TRIGGER {
    WORD cbTriggerSize; 
    WORD Reserved1;
    WORD wBeginYear;            
    WORD wBeginMonth;           
    WORD wBeginDay;             
    WORD wEndYear;              
    WORD wEndMonth;             
    WORD wEndDay;               
    WORD wStartHour;            
    WORD wStartMinute;          
    DWORD MinutesDuration;      
    DWORD MinutesInterval;      
    DWORD rgFlags;              
    TASK_TRIGGER_TYPE TriggerType;
    TRIGGER_TYPE_UNION Type;
    WORD Reserved2;
    WORD wRandomMinutesInterval;
} TASK_TRIGGER, * PTASK_TRIGGER;

Defines the start time, end time, duration, and modification flags for a task.

cbTriggerSize
Size of this structure, in bytes (sizeof(TASK_TRIGGER)).
Reserved1
For internal use only; this value must be zero.
wBeginYear
Year that the task trigger activates. This value must be four digits (1997, not 97).
wBeginMonth
Month of the year in the wBeginYear member that the task trigger activates.
wBeginDay
Day of the month in the wBeginMonth member that the task trigger activates.
wEndYear
Year that the task trigger deactivates. This value must be four digits (1997, not 97).
wEndMonth
Month of the year in the wEndYear member that the task trigger deactivates.
wEndDay
Day of the month in the wEndMonth member that the task trigger deactivates.
wStartHour
Hour of the day the task runs. This value is on a 24-hour clock; hours go from 00 to 23.
wStartMinute
Minute of the hour in the wStartHour member that the task runs.
MinutesDuration
Number of minutes after the task starts that the trigger will remain active. For example, if you start a task at 8:00 A.M. and want to repeatedly start the task until 5:00 P.M., there would be 540 minutes in the duration.
MinutesInterval
Number of minutes between consecutive task executions. This number is counted from the start of the previous task. For example, to run a task every hour from 8:00 A.M. to 5:00 P.M., set this field to 60.
rgFlags
Value that describes the task trigger's behavior. This value is a combination of the following flags:
TASK_TRIGGER_FLAG_HAS_END_DATE
Trigger structure's end date is valid. If this flag is not set, the end date data is ignored and the trigger will be valid indefinitely.
TASK_TRIGGER_FLAG_KILL_AT_DURATION_END
Task will be terminated at the end of the active trigger's lifetime. At the duration end, the scheduling agent first sends a WM_CLOSE message to the associated application. If the application hasn't exited in three minutes, TerminateProcess runs. If more than one instance of a task is running, all instances are terminated.
TASK_TRIGGER_FLAG_DISABLED
Task trigger is inactive.
TriggerType
Value that determines the type of trigger for this task. This value is a member of the TASK_TRIGGER_TYPE enumerated type.
Type
Structure that determines the type of trigger for this task. This structure is a member of the TRIGGER_TYPE_UNION union.
Reserved2
For internal use only; this value must be zero.
wRandomMinutesInterval
Not currently used.

Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.