1 out of 1 rated this helpful - Rate this topic

DeleteTimerQueueEx function

Applies to: desktop apps only

Deletes a timer queue. Any pending timers in the queue are canceled and deleted.

Syntax

BOOL WINAPI DeleteTimerQueueEx(
  __in      HANDLE TimerQueue,
  __in_opt  HANDLE CompletionEvent
);

Parameters

TimerQueue [in]

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

CompletionEvent [in, optional]

A handle to the event object to be signaled when the function is successful and all callback functions have completed. This parameter can be NULL.

If this parameter is INVALID_HANDLE_VALUE, the function waits for all callback functions to complete before returning.

If this parameter is NULL, the function marks the timer for deletion and returns immediately. However, most callers should wait for the callback function to complete so they can perform any needed cleanup.

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

Do not make blocking calls to DeleteTimerQueueEx from within a timer callback.

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

Minimum supported server

Windows Server 2003

Header

WinBase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

CreateTimerQueue
DeleteTimerQueueTimer
Synchronization Functions
Thread Pooling
Timer Queues

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
DLL and DeleteTimer.* functions
If your dll is deadlocked in DLL_PROCESS_DETACH make sure you are not waiting for a thread to finish.
For example the WaitForSingleObject on the completion event handle.

In order for a thread that was created in a dll to exit it needs to send out DDLL_THREAD_DETACH to all of the dll's in the process address space.
If the dll is waiting for the thread to exit as a result of DLL_PROCESS_DETACH(or something similar) then it deadlocks.

More information in:
http://blogs.msdn.com/b/oldnewthing/archive/2007/09/04/4731478.aspx