网站首页  词典首页

请输入您要查询的函数:

 

术语 setevent
释义 SetEvent
语法:
C++
BOOL WINAPI SetEvent(
__in HANDLE hEvent
);
SetEvent函数
设置指定事件对象的信号状态。
参数
hEvent [in]
阿处理该事件的对象。在CreateEvent或OpenEvent函数返回此句柄。
句柄必须有EVENT_MODIFY_STATE访问权限。有关更多信息,请参阅同步对象的安全和访问权限。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
一个手动重置事件对象的状态仍然暗示,直到它被设置明确的ResetEvent函数的无信号状态。任何等待线程或线程的数目随后开始等待指定的事件对象操作通过调用等功能之一,可以释放,而该对象的状态信号。
在自动状态重置事件对象保持信号,直到一个等待线程被释放,此时,系统会自动设置状态,无信号。如果没有线程在等待,事件对象的状态保持信号。
设置一个已经设定事件没有任何效果。
实例
举一个例子,它使用SetEvent,请使用事件对象。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
CreateEvent
事件对象
OpenEvent
PulseEvent
ResetEvent
同步功能
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==SetEvent Function
Sets the specified event object to the signaled state.
Syntax
C++
BOOL WINAPI SetEvent(
__in HANDLE hEvent
);
Parameters
hEvent [in]
A handle to the event object. The CreateEvent or OpenEvent function returns this handle.
The handle must have the EVENT_MODIFY_STATE access right. For more information, see Synchronization Object Security and Access Rights .
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
The state of a manual-reset event object remains signaled until it is set explicitly to the nonsignaled state by the ResetEvent function. Any number of waiting threads, or threads that subsequently begin wait operations for the specified event object by calling one of the wait functions , can be released while the object's state is signaled.
The state of an auto-reset event object remains signaled until a single waiting thread is released, at which time the system automatically sets the state to nonsignaled. If no threads are waiting, the event object's state remains signaled.
Setting an event that is already set has no effect.
Examples
For an example that uses SetEvent, see Using Event Objects .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
CreateEvent
Event Objects
OpenEvent
PulseEvent
ResetEvent
Synchronization Functions
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms686211(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:15:27