Skip to content

Latest commit

 

History

History
168 lines (110 loc) · 4.9 KB

nf-mstask-ischeduledworkitem-getstatus.md

File metadata and controls

168 lines (110 loc) · 4.9 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.GetStatus
IScheduledWorkItem::GetStatus (mstask.h)
Retrieves the status of the work item.
GetStatus
GetStatus method [Task Scheduler]
GetStatus method [Task Scheduler]
IScheduledWorkItem interface
IScheduledWorkItem interface [Task Scheduler]
GetStatus method
IScheduledWorkItem.GetStatus
IScheduledWorkItem::GetStatus
_msb_ischeduledworkitem_getstatus
mstask/IScheduledWorkItem::GetStatus
taskschd.ischeduledworkitem_getstatus
taskschd\ischeduledworkitem_getstatus.htm
taskschd
fb0bc52c-ae50-4c14-864d-099f2903adfb
12/05/2018
GetStatus, GetStatus method [Task Scheduler], GetStatus method [Task Scheduler],IScheduledWorkItem interface, IScheduledWorkItem interface [Task Scheduler],GetStatus method, IScheduledWorkItem.GetStatus, IScheduledWorkItem::GetStatus, _msb_ischeduledworkitem_getstatus, mstask/IScheduledWorkItem::GetStatus, taskschd.ischeduledworkitem_getstatus
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::GetStatus
mstask/IScheduledWorkItem::GetStatus
c++
APIRef
kbSyntax
COM
Mstask.dll
IScheduledWorkItem.GetStatus

IScheduledWorkItem::GetStatus

-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 status of the work item.

-parameters

-param phrStatus [out]

A pointer to an HRESULT value that contains one of the following values on return.

SCHED_S_TASK_READY

The work item is ready to run at its next scheduled time.

SCHED_S_TASK_RUNNING

The work item is currently running.

SCHED_S_TASK_NOT_SCHEDULED

One or more of the properties that are needed to run this task on a schedule have not been set.

SCHED_S_TASK_HAS_NOT_RUN

The task has not been run. This value is returned whenever the task has not been run, even if the task is ready to be run at the next scheduled time or the task is a recurring task.

SCHED_S_TASK_DISABLED

The task will not run at the scheduled times because it has been disabled.

SCHED_S_TASK_NO_MORE_RUNS

There are no more runs scheduled for this task.

SCHED_S_TASK_NO_VALID_TRIGGERS

Either the task has no triggers or the existing triggers are disabled or not set.

-returns

The GetStatus method returns one of the following values.

Return code Description
S_OK
The operation was successful. The request was sent. For more information, see Remarks.
E_INVALIDARG
The arguments are not valid.

-remarks

The methods of the IScheduledWorkItem interface are inherited by the ITask interface. Consequently, IScheduledWorkItem::GetStatus is typically called through the ITask interface.

IScheduledWorkItem::GetStatus does not obtain the status of the task dynamically. ITaskScheduler::Activate should be called to obtain a new IScheduledWorkItem interface, which is used to get an updated status. For more information, see the example for ITaskScheduler::Activate.

Examples

For an example of how to retrieve the status of a task, see C/C++ Code Example: Retrieving Task Status.

For an example of how to retrieve the task status as part of terminating the task, see Terminating a Task Example.

-see-also

IScheduledWorkItem

ITask