网站首页  词典首页

请输入您要查询的函数:

 

术语 deletetimerqueuetimer
释义 DeleteTimerQueueTimer
语法:
C++
BOOL WINAPI DeleteTimerQueueTimer(
__in_opt HANDLE TimerQueue,
__in HANDLE Timer,
__in_opt HANDLE CompletionEvent
);
DeleteTimerQueueTimer功能
取消挂起的定时器队列计时器。
参数
TimerQueue [中,可选]
一个句柄,计时器队列。这种处理是由CreateTimerQueue函数返回。
如果计时器是使用默认的定时器队列,此参数应为NULL。
定时器 [in]
一个句柄,计时器队列计时器。这种处理是由CreateTimerQueueTimer函数返回。
CompletionEvent [中,可选]
句柄的事件对象时,将信号的功能,是成功的,计时器回调函数完成。此参数可以为NULL。
如果此参数为INVALID_HANDLE_VALUE,函数等待返回之前完成的计时器回调函数。
如果该参数为NULL,函数标记为删除,并立即返回计时器。如果计时器已过期,定时器回调函数将运行完成。然而,没有发出通知时,计时器回调函数完成。大部分听众不应使用此选项,并且应当等待计时器回调函数来完成,使他们能够执行任何所需的清理工作。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。如果错误代码是ERROR_IO_PENDING,但没有必要再调用此函数。对于任何其他错误,您应该请重试。
备注
此函数不能称为线程,而使用模拟。由此产生的行为是不确定的。
您可以设置CompletionEvent为INVALID_HANDLE_VALUE在调用从另一只要长期定时器回调函数计时器回调这个功能在计时器线程中执行。不过,可能会发生死锁如果两个回调函数试图封锁DeleteTimerQueueTimer对彼此的计时器的呼吁。此外,您不能与回调相关的计时器的呼叫阻塞删除。
决策时要小心在永久线程阻塞DeleteTimerQueueTimer电话。如果计时器被删除创造了与WT_EXECUTEINPERSISTENTTHREAD,可能会发生死锁。
如果有杰出的回调函数和CompletionEvent为NULL,则函数将失败并设置错误代码ERROR_IO_PENDING。这表明,有杰出的回调函数。这些回调也将执行或在执行中的。计时器清理时,回调函数执行完毕。
若要取消一个计时器队列中的所有定时器,调用DeleteTimerQueueEx功能。
要编译的应用程序使用此功能,定义_WIN32_WINNT为0x0500或更高版本。有关详细信息,请参阅使用Windows头。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
CreateTimerQueue
CreateTimerQueueTimer
DeleteTimerQueueEx
同步功能
定时器队列
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==DeleteTimerQueueTimer Function
Cancels a pending timer-queue timer.
Syntax
C++
BOOL WINAPI DeleteTimerQueueTimer(
__in_opt HANDLE TimerQueue,
__in HANDLE Timer,
__in_opt HANDLE CompletionEvent
);
Parameters
TimerQueue [in, optional]
A handle to the timer queue. This handle is returned by the CreateTimerQueue function.
If the timer was created using the default timer queue, this parameter should be NULL.
Timer [in]
A handle to the timer-queue timer. This handle is returned by the CreateTimerQueueTimer function.
CompletionEvent [in, optional]
A handle to the event object to be signaled when the function is successful and the timer callback function has completed. This parameter can be NULL.
If this parameter is INVALID_HANDLE_VALUE, the function waits for the timer callback function to complete before returning.
If this parameter is NULL, the function marks the timer for deletion and returns immediately. If the timer has already expired, the timer callback function will run to completion. However, there is no notification sent when the timer callback function has completed. Most callers should not use this option, and should wait for the timer 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 . If the error code is ERROR_IO_PENDING, it is not necessary to call this function again. For any other error, you should retry the call.
Remarks
This function cannot be called while the thread is using impersonation. The resulting behavior is undefined.
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 make a blocking deletion call on a timer associated with the callback.
Be careful when making a blocking DeleteTimerQueueTimer call on a persistent thread. If the timer being deleted was created with WT_EXECUTEINPERSISTENTTHREAD, a deadlock may occur.
If there are outstanding callback functions and CompletionEvent is NULL, the function will fail and set the error code to ERROR_IO_PENDING. This indicates that there are outstanding callback functions. Those callbacks either will execute or are in the middle of executing. The timer is cleaned up when the callback function is finished executing.
To cancel all timers in a timer queue, call the DeleteTimerQueueEx function.
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 clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
CreateTimerQueue
CreateTimerQueueTimer
DeleteTimerQueueEx
Synchronization Functions
Timer Queues
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms682569(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:16:34