Platform SDK: DLLs, Processes, and Threads |
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 );
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.
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.
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.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Unsupported.
Header: Declared in Winbase.h; include Windows.h.
Library: Use Kernel32.lib.
Synchronization Overview, Synchronization Functions, CreateTimerQueue, CreateTimerQueueTimer, DeleteTimerQueueEx, Thread Pooling