Kernel32WaitForSingleObjectEx Method
Waits until the specified object is in the signaled state,
an I/O completion routine or asynchronous procedure call (APC) is queued to the thread,
or the time-out interval elapses.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", SetLastError = true)]
public static WaitObjectResult WaitForSingleObjectEx(
IntPtr handle,
uint milliseconds,
bool alertable
)
<DllImportAttribute("Kernel32.dll", SetLastError := true>]
Public Shared Function WaitForSingleObjectEx (
handle As IntPtr,
milliseconds As UInteger,
alertable As Boolean
) As WaitObjectResult
Dim handle As IntPtr
Dim milliseconds As UInteger
Dim alertable As Boolean
Dim returnValue As WaitObjectResult
returnValue = Kernel32.WaitForSingleObjectEx(handle,
milliseconds, alertable)
public:
[DllImportAttribute(L"Kernel32.dll", SetLastError = true)]
static WaitObjectResult WaitForSingleObjectEx(
IntPtr handle,
unsigned int milliseconds,
bool alertable
)
[<DllImportAttribute("Kernel32.dll", SetLastError = true)>]
static member WaitForSingleObjectEx :
handle : IntPtr *
milliseconds : uint32 *
alertable : bool -> WaitObjectResult
No code example is currently available or this language may not be supported.
- handle IntPtr
-
A handle to the object.
If this handle is closed while the wait is still pending, the function's behavior is undefined.
The handle must have the SYNCHRONIZE access right.
- milliseconds UInt32
-
The time-out interval, in milliseconds.
If a nonzero value is specified, the function waits until the object is signaled,
an I/O completion routine or APC is queued, or the interval elapses.
If milliseconds is zero,
the function does not enter a wait state if the criteria is not met; it always returns immediately.
If milliseconds is INFINITE (0xFFFFFFFF),
the function will return only when the object is signaled or an I/O completion routine or APC is queued
- alertable Boolean
-
If this parameter is and the thread is in the waiting state,
the function returns when the system queues an I/O completion routine or APC,
and the thread runs the routine or function.
Otherwise, the function does not return, and the completion routine or APC function is not executed.
A completion routine is queued when the ReadFileEx or WriteFileEx function
in which it was specified has completed.
The wait function returns and the completion routine is called only if bAlertable is ,
and the calling thread is the thread that initiated the read or write operation.
An APC is queued when you call QueueUserAPC.
WaitObjectResult
If the function succeeds, the return value indicates the event that caused the function to return.