
This section describes the Task Scheduler structures.
typedef struct _DAILY {
WORD DaysInterval;
} DAILY;
Defines the interval, in days, between invocations of a task. The TRIGGER_TYPE_UNION union uses an instance of this structure as part of the TASK_TRIGGER structure definition.
typedef struct _MONTHLYDATE {
DWORD rgfDays;
WORD rgfMonths;
} MONTHLYDATE;
Defines the day of the month the task will run. The TRIGGER_TYPE_UNION union uses an instance of this structure as part of the TASK_TRIGGER structure definition.
| TASK_JANUARY | Task will run in January. |
| TASK_FEBRUARY | Task will run in February. |
| TASK_MARCH | Task will run in March. |
| TASK_APRIL | Task will run in April. |
| TASK_MAY | Task will run in May. |
| TASK_JUNE | Task will run in June. |
| TASK_JULY | Task will run in July. |
| TASK_AUGUST | Task will run in August. |
| TASK_SEPTEMBER | Task will run in September. |
| TASK_OCTOBER | Task will run in October. |
| TASK_NOVEMBER | Task will run in November. |
| TASK_DECEMBER | Task will run in December. |
The following code fragment provides an example of how you can combine these flags. This example would run a task quarterly.
MONTHLYDATE example; example.rgfDays = 1; example.rgfMonths = TASK_JANUARY | TASK_APRIL | TASK_JULY | TASK_OCTOBER;
typedef struct _MONTHLYDOW {
WORD wWhichWeek;
WORD rgfDaysOfTheWeek;
WORD rgfMonths;
} MONTHLYDOW;
(MONTHLY Day Of the Week) Defines the date(s) that the task runs by month, week, and day of week. The TRIGGER_TYPE_UNION union uses an instance of this structure as part of the TASK_TRIGGER structure definition.
| TASK_FIRST_WEEK | Task will run during the first week of the month. |
| TASK_SECOND_WEEK | Task will run during the second week of the month. |
| TASK_THIRD_WEEK | Task will run during the third week of the month. |
| TASK_FOURTH_WEEK | Task will run during the fourth week of the month. |
| TASK_LAST_WEEK | Task will run during the last week of the month. |
| TASK_SUNDAY | Task will run on Sunday. |
| TASK_MONDAY | Task will run on Monday. |
| TASK_TUESDAY | Task will run on Tuesday. |
| TASK_WEDNESDAY | Task will run on Wednesday. |
| TASK_THURSDAY | Task will run on Thursday. |
| TASK_FRIDAY | Task will run on Friday. |
| TASK_SATURDAY | Task will run on Saturday. |
| TASK_JANUARY | Task will run in January. |
| TASK_FEBRUARY | Task will run in February. |
| TASK_MARCH | Task will run in March. |
| TASK_APRIL | Task will run in April. |
| TASK_MAY | Task will run in May. |
| TASK_JUNE | Task will run in June. |
| TASK_JULY | Task will run in July. |
| TASK_AUGUST | Task will run in August. |
| TASK_SEPTEMBER | Task will run in September. |
| TASK_OCTOBER | Task will run in October. |
| TASK_NOVEMBER | Task will run in November. |
| TASK_DECEMBER | Task will run in December. |
The following code fragment provides an example of how you can combine these flags. This example would run a task on Monday and Friday of the third week of every third month.
MONTHLYDOW example; example.wWhichWeek = TASK_THIRD_WEEK; example.rgfDaysOfTheWeek = TASK_FRIDAY | TASK_MONDAY; example.rgfMonths = TASK_JANUARY | TASK_APRIL | TASK_JULY | TASK_OCTOBER;
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.
typedef struct _WEEKLY {
WORD WeeksInterval;
WORD rgfDaysOfTheWeek;
} WEEKLY;
Defines the interval, in weeks, between invocations of a task. The TRIGGER_TYPE_UNION union uses an instance of this structure as part of the TASK_TRIGGER structure definition.
| TASK_SUNDAY | Task will run on Sunday. |
| TASK_MONDAY | Task will run on Monday. |
| TASK_TUESDAY | Task will run on Tuesday. |
| TASK_WEDNESDAY | Task will run on Wednesday. |
| TASK_THURSDAY | Task will run on Thursday. |
| TASK_FRIDAY | Task will run on Friday. |
| TASK_SATURDAY | Task will run on Saturday. |
The following code fragment provides an example of how you can combine these flags. This example would run a task on every other Sunday, Wednesday, and Friday.
WEEKLY example; example.WeeksInterval = 2; example.rgfDaysOfTheWeek = TASK_SUNDAY | TASK_WEDNESDAY | TASK_FRIDAY;
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.