Skip to content

Latest commit

 

History

History
98 lines (72 loc) · 4.44 KB

nf-mstask-ischeduledworkitem-setidlewait.md

File metadata and controls

98 lines (72 loc) · 4.44 KB
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.SetIdleWait
IScheduledWorkItem::SetIdleWait (mstask.h)
Sets the minutes that the system must be idle before the work item can run.
IScheduledWorkItem interface [Task Scheduler]
SetIdleWait method
IScheduledWorkItem.SetIdleWait
IScheduledWorkItem::SetIdleWait
SetIdleWait
SetIdleWait method [Task Scheduler]
SetIdleWait method [Task Scheduler]
IScheduledWorkItem interface
_msb_ischeduledworkitem_setidlewait
mstask/IScheduledWorkItem::SetIdleWait
taskschd.ischeduledworkitem_setidlewait
taskschd\ischeduledworkitem_setidlewait.htm
taskschd
f7ad639a-4094-4621-9add-b89958c0bda4
12/05/2018
IScheduledWorkItem interface [Task Scheduler],SetIdleWait method, IScheduledWorkItem.SetIdleWait, IScheduledWorkItem::SetIdleWait, SetIdleWait, SetIdleWait method [Task Scheduler], SetIdleWait method [Task Scheduler],IScheduledWorkItem interface, _msb_ischeduledworkitem_setidlewait, mstask/IScheduledWorkItem::SetIdleWait, taskschd.ischeduledworkitem_setidlewait
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
IScheduledWorkItem::SetIdleWait
mstask/IScheduledWorkItem::SetIdleWait
c++
APIRef
kbSyntax
COM
Mstask.dll
IScheduledWorkItem.SetIdleWait

IScheduledWorkItem::SetIdleWait

-description

[[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 minutes that the system must be idle before the work item can run.

-parameters

-param wIdleMinutes [in]

A value that specifies how long, in minutes, the system must remain idle before the work item can run.

-param wDeadlineMinutes [in]

A value that specifies the maximum number of minutes that the Task Scheduler will wait for the idle-time period returned in pwIdleMinutes.

-returns

The SetIdleWait method returns S_OK.

-remarks

The idle time specified here is used in conjunction with idle triggers and idle conditions. For more information, see Task Idle Conditions. Idle triggers are event-based triggers that are not associated with a scheduled time. Idle conditions, in contrast, are associated with the scheduled start time for the task.

You specify idle triggers by setting the TASK_TRIGGER_TYPE member of the TASK_TRIGGER to TASK_EVENT_TRIGGER_ON_IDLE. The idle trigger is fired when the system becomes idle for the amount of time specified by wIdleMinutes.

You set idle conditions by calling IScheduledWorkItem::SetFlags. If the TASK_FLAG_START_ONLY_IF_IDLE flag is set, the work item runs at its scheduled time only if the system becomes idle for the amount of time specified by wIdleMinutes. The Task Scheduler service will wait up to the number of minutes specified in wDeadlineMinutes past the scheduled start time to see if the system becomes idle.

Applications must call the IPersistFile::Save method after calling SetIdleWait to update the idle wait interval.

Examples

For an example of how to set the idle wait time when creating an idle trigger, see Creating an Idle Trigger Example.

-see-also

IScheduledWorkItem

IScheduledWorkItem::GetIdleWait