Contents Index Topic Contents | ||
Previous Topic: IScheduledWorkItem::SetErrorRetryInterval Next Topic: IScheduledWorkItem::SetIdleWait |
IScheduledWorkItem::SetFlags
HRESULT SetFlags( DWORD dwFlags );Sets the flags that modify the task's behavior.
- Returns one of the following values:
S_OK The operation was successful. E_INVALIDARG The arguments are not valid. E_OUTOFMEMORY Not enough memory is available.
- dwFlags
- Value that contains a combination of one or more of the following flags:
- TASK_FLAG_INTERACTIVE
- This task flag is used when converting Windows NT AT service jobs into tasks. The Windows NT AT service job refers to At.exe, the Windows NT command-line utility used for creating jobs for the Windows NT Schedule service. The Task Scheduler service replaces the Schedule service and is backward-compatible with it. This conversion occurs when the Task Scheduler is installed on Windows NT; for example, installing Internet Explorer 4.0, or upgrading to Windows NT 5. During the setup process, the Task Scheduler installation code searches the registry for jobs created for the AT service, and creates tasks that will accomplish the same operation.
For such converted jobs, the interactive flag is set if the task is intended to be displayed to the user. When this flag is not set, no task items are displayed in the Tasks folder, and no user interface associated with the task is presented to the user when the task is executed.
- TASK_FLAG_DELETE_WHEN_DONE
- Task will be deleted when there are no more scheduled run times.
- TASK_FLAG_DISABLED
- Task is disabled. This is useful to temporarily prevent a task from running at the scheduled time(s).
- TASK_FLAG_HIDDEN
- Task file is hidden. When the task begins execution, it runs in a hidden window.
- TASK_FLAG_START_ONLY_IF_IDLE
- Task begins only if the computer is not in use at the scheduled start time. Windows 95 only.
- TASK_FLAG_KILL_ON_IDLE_END
- Task terminates if the computer makes an idle to non-idle transition while the task is running. The computer is not considered idle until the IdleWait triggers' time elapses with no user input. Windows 95 only. For information regarding idle triggers, see Idle Triggers.
- TASK_FLAG_RESTART_ON_IDLE_RESUME
- Task starts again if the computer makes a non-idle to idle transition before all its triggers' dwMinutesDuration elapse. (Use this flag in conjunction with TASK_FLAG_KILL_ON_IDLE_END.) Windows 95 only.
- TASK_FLAG_DONT_START_IF_ON_BATTERIES
- Task does not start if its target computer is running on battery power. Windows 95 only.
- TASK_FLAG_KILL_IF_GOING_ON_BATTERIES
- Task ends and the associated application quits if the task's target computer switches to battery power. Windows 95 only.
- TASK_FLAG_RUN_IF_CONNECTED_TO_INTERNET
- Task runs only if there is currently a valid Internet connection. Note: This feature is currently not implemented.
See also IScheduledWorkItem::GetFlags
Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.