ChangeTimerQueueTimer function

Updates a timer-queue timer that was created by the CreateTimerQueueTimer function.

Syntax

BOOL ChangeTimerQueueTimer(
  HANDLE TimerQueue,
  HANDLE Timer,
  ULONG  DueTime,
  ULONG  Period
);

Parameters

TimerQueue

A handle to the timer queue. This handle is returned by the CreateTimerQueue function.

If this parameter is NULL, the timer is associated with the default timer queue.

Timer

A handle to the timer-queue timer. This handle is returned by the CreateTimerQueueTimer function.

DueTime

The time after which the timer should expire, in milliseconds.

Period

The period of the timer, in milliseconds. If this parameter is zero, the timer is signaled once. If this parameter is greater than zero, the timer is periodic. A periodic timer automatically reactivates each time the period elapses, until the timer is canceled using the DeleteTimerQueueTimer function or reset using ChangeTimerQueueTimer.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

This function cannot be called while the thread is using impersonation. The resulting behavior is undefined.

You can call ChangeTimerQueueTimer in a timer callback.

If you call ChangeTimerQueueTimer on a one-shot timer (its period is zero) that has already expired, the timer is not updated.

Do not call ChangeTimerQueueTimer after calling DeleteTimerQueueTimer on a handle.

To compile an application that uses this function, define _WIN32_WINNT as 0x0500 or later. For more information, see Using the Windows Headers.

Requirements

   
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header threadpoollegacyapiset.h
Library Kernel32.lib
DLL Kernel32.dll

See Also

CreateTimerQueue

CreateTimerQueueTimer

DeleteTimerQueueTimer

Synchronization Functions

Thread Pooling

Timer Queues