Platform SDK: DLLs, Processes, and Threads

DeleteTimerQueueTimer

The DeleteTimerQueueTimer function cancels a timer-queue timer.

BOOL DeleteTimerQueueTimer(
  HANDLE TimerQueue,      // handle to timer queue
  HANDLE Timer,           // handle to timer
  HANDLE CompletionEvent  // handle to completion event
);

Parameters

TimerQueue
[in] Handle to a timer queue. This handle is returned by the CreateTimerQueue function.
Timer
[in] Handle to a timer-queue timer. This handle is returned by the CreateTimerQueueTimer function.
CompletionEvent
[in] Specifies the event to be signaled when the function is successful and all callback functions have completed.

If this parameter is not INVALID_HANDLE_VALUE, the function is non-blocking; it does not wait for all callback functions to complete. Otherwise, the function returns immediately.

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 set CompletionEvent to INVALID_HANDLE_VALUE when calling this function from within the timer callback of another timer as long as the callback function is not executed in the timer thread. However, a deadlock may occur if two callback functions attempt a blocking DeleteTimerQueueTimer call on each others' timers. Furthermore, you cannot making a blocking deletion call on a timer associated with the callback.

To cancel all timers in a timer queue, call the DeleteTimerQueueEx function.

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, DeleteTimerQueueEx, Thread Pooling