IRegisteredTask::GetRunTimes method (taskschd.h)

Gets the times that the registered task is scheduled to run during a specified time.

Syntax

HRESULT GetRunTimes(
  [in]      const LPSYSTEMTIME pstStart,
  [in]      const LPSYSTEMTIME pstEnd,
  [in, out] DWORD              *pCount,
  [out]     LPSYSTEMTIME       *pRunTimes
);

Parameters

[in] pstStart

The starting time for the query.

[in] pstEnd

The ending time for the query.

[in, out] pCount

The requested number of runs on input and the returned number of runs on output.

[out] pRunTimes

The scheduled times that the task will run. A NULL LPSYSTEMTIME object should be passed into this parameter. On return, this array contains pCount run times. You must free this array by a calling the CoTaskMemFree function.

Return value

If the method succeeds, it returns S_OK. If the method returns S_FALSE, the pRunTimes parameter contains pCount items, but there were more runs of the task, that were not returned. Otherwise, it returns an HRESULT error code.

Remarks

If the registered task contains triggers that are individually disabled, these triggers will still affect the next scheduled run time that is returned even though they are disabled.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header taskschd.h
Library Taskschd.lib
DLL Taskschd.dll

See also

IRegisteredTask

Task Scheduler