UID | title | description | helpviewer_keywords | old-location | tech.root | ms.assetid | ms.date | ms.keywords | req.header | req.include-header | req.target-type | req.target-min-winverclnt | req.target-min-winversvr | req.kmdf-ver | req.umdf-ver | req.ddi-compliance | req.unicode-ansi | req.idl | req.max-support | req.namespace | req.assembly | req.type-library | req.lib | req.dll | req.irql | targetos | req.typenames | req.redist | ms.custom | f1_keywords | dev_langs | topic_type | api_type | api_location | api_name | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NF:mstask.IScheduledWorkItem.SetFlags |
IScheduledWorkItem::SetFlags (mstask.h) |
Sets the flags that modify the behavior of any type of work item. |
|
taskschd\ischeduledworkitem_setflags.htm |
taskschd |
640ba3c7-ed9d-4c4c-82fd-34fc777172c2 |
12/05/2018 |
IScheduledWorkItem interface [Task Scheduler],SetFlags method, IScheduledWorkItem.SetFlags, IScheduledWorkItem::SetFlags, SetFlags, SetFlags method [Task Scheduler], SetFlags method [Task Scheduler],IScheduledWorkItem interface, _msb_ischeduledworkitem_setflags, mstask/IScheduledWorkItem::SetFlags, taskschd.ischeduledworkitem_setflags |
mstask.h |
Windows |
Windows 2000 Professional [desktop apps only] |
Windows 2000 Server [desktop apps only] |
Mstask.lib |
Mstask.dll |
Windows |
Internet Explorer 4.0 or later on Windows NT 4.0 and Windows 95 |
19H1 |
|
|
|
|
|
|
[[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.] ]
Sets the flags that modify the behavior of any type of work item.
A value that specifies a combination of one or more of the following flags:
This flag is used when converting Windows NT AT service jobs into work items. 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. The conversion occurs when the Task Scheduler is installed on Windows NT/Windows 2000— for example, if you install Internet Explorer 4.0, or upgrade to Windows 2000. During the setup process, the Task Scheduler installation code searches the registry for jobs created for the AT service and creates work items that will accomplish the same operation.
For such converted jobs, the interactive flag is set if the work item is intended to be displayed to the user. When this flag is not set, no work items are displayed in the Tasks folder, and no user interface associated with the work item is presented to the user when the work item is executed.
The work item will be deleted when there are no more scheduled run times.
The work item is disabled. This is useful to temporarily prevent a work item from running at the scheduled time(s).
TASK_FLAG_HIDDEN
The work item created will be hidden.
The work item runs only if the user specified in IScheduledWorkItem::SetAccountInformation is logged on interactively. This flag has no effect on the work items that are set to run in the local account.
The work item begins only if the computer is not in use at the scheduled start time.
The work item causes the system to be resumed, or awakened, if the system is running on battery power. This flag is supported only on systems that support resume timers.
The work item terminates if the computer makes an idle to non-idle transition while the work item is running. The computer is not considered idle until the IdleWait triggers' time elapses with no user input. For information regarding idle triggers, see Idle Trigger.
The work item starts again if the computer makes a non-idle to idle transition before all the work item's task_triggers elapse. (Use this flag in conjunction with TASK_FLAG_KILL_ON_IDLE_END.)
The work item does not start if its target computer is running on battery power.
The work item ends, and the associated application quits if the work item's target computer switches to battery power.
The work item runs only if there is currently a valid Internet connection.
The SetFlags method returns one of the following values.
Return code | Description |
---|---|
|
The operation was successful. |
|
The arguments are not valid. |
|
Not enough memory is available. |
Programs must call the IPersistFile::Save method after calling SetFlags to update the flags.
This method is used to set those flags used by any type of scheduled work item. In contrast, ITask::SetTaskFlags is used only to set flags used by scheduled tasks.