Platform SDK: DLLs, Processes, and Threads

ChangeTimerQueueTimer

The ChangeTimerQueueTimer function updates a timer-queue timer that was created by the CreateTimerQueueTimer function.

BOOL ChangeTimerQueueTimer(
  HANDLE TimerQueue,  // handle to timer queue
  HANDLE Timer,       // handle to timer
  ULONG DueTime,      // timer due time
  ULONG Period        // timer period
);

Parameters

TimerQueue
[in] Handle to a 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
[in] Handle to a timer-queue timer. This handle is returned by the CreateTimerQueueTimer function.
DueTime
[in] Specifies the time, in milliseconds, after which the timer should expire.
Period
[in] Specifies the period of the timer, in milliseconds. If Period is zero, the timer is signaled once. If Period 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 Values

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

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.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Unsupported.
  Header: Declared in Winbase.h; include Windows.h.
  Library: Use Kernel32.lib.

See Also

Synchronization Overview, Synchronization Functions, CreateTimerQueue, CreateTimerQueueTimer, DeleteTimerQueueTimer, Thread Pooling