Skip to content

Latest commit

 

History

History
127 lines (98 loc) · 4.7 KB

nf-mstask-ischeduledworkitem-getidlewait.md

File metadata and controls

127 lines (98 loc) · 4.7 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.GetIdleWait
IScheduledWorkItem::GetIdleWait (mstask.h)
Retrieves the idle wait time for the work item.
GetIdleWait
GetIdleWait method [Task Scheduler]
GetIdleWait method [Task Scheduler]
IScheduledWorkItem interface
IScheduledWorkItem interface [Task Scheduler]
GetIdleWait method
IScheduledWorkItem.GetIdleWait
IScheduledWorkItem::GetIdleWait
_msb_ischeduledworkitem_getidlewait
mstask/IScheduledWorkItem::GetIdleWait
taskschd.ischeduledworkitem_getidlewait
taskschd\ischeduledworkitem_getidlewait.htm
taskschd
72d53691-f2ea-4a20-8e85-f9db81f830cd
12/05/2018
GetIdleWait, GetIdleWait method [Task Scheduler], GetIdleWait method [Task Scheduler],IScheduledWorkItem interface, IScheduledWorkItem interface [Task Scheduler],GetIdleWait method, IScheduledWorkItem.GetIdleWait, IScheduledWorkItem::GetIdleWait, _msb_ischeduledworkitem_getidlewait, mstask/IScheduledWorkItem::GetIdleWait, taskschd.ischeduledworkitem_getidlewait
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::GetIdleWait
mstask/IScheduledWorkItem::GetIdleWait
c++
APIRef
kbSyntax
COM
Mstask.dll
IScheduledWorkItem.GetIdleWait

IScheduledWorkItem::GetIdleWait

-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.] ]

Retrieves the idle wait time for the work item.

For information about idle conditions, see Task Idle Conditions.

-parameters

-param pwIdleMinutes [out]

A pointer to a WORD that contains the idle wait time for the current work item, in minutes.

-param pwDeadlineMinutes [out]

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

-returns

The GetIdleWait method returns one of the following values.

Return code Description
S_OK
The operation was successful.
E_INVALIDARG
The arguments are not valid.

-remarks

The idle time returned here is used in conjunction with idle triggers and idle conditions. Idle triggers are event-based triggers that are not associated with a scheduled time. Idle conditions are associated with the scheduled start time for the task.

Idle triggers are specified by setting the TASK_TRIGGER_TYPE member of the TASK_TRIGGER structure to the value TASK_EVENT_TRIGGER_ON_IDLE. The idle trigger is fired when the system becomes idle for the amount of time returned in pwIdleMinutes.

You can 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 returned in pwIdleMinutes. The Task Scheduler service will wait up to pwDeadlineMinutes past the scheduled start time to see if the system becomes idle.

Examples

For an example of how to retrieve the idle wait time of a task, see C/C++ Code Example: Retrieving Task Idle-wait Time.

-see-also

IScheduledWorkItem

IScheduledWorkItem::SetIdleWait