The WaitForSingleObject function returns when one of the following occurs:
· The specified object is in the signaled state.
· The time-out interval elapses.
DWORD WaitForSingleObject(
HANDLE hHandle, // handle of object to wait for
DWORD dwMilliseconds // time-out interval in milliseconds
);
Parameters
hHandle
Identifies the object. For a list of the object types whose handles can be specified, see the following Remarks section.
Windows NT: The handle must have SYNCHRONIZE access. For more information, see Access Masks and Access Rights.
dwMilliseconds
Specifies the time-out interval, in milliseconds. The function returns if the interval elapses, even if the object's state is nonsignaled. If dwMilliseconds is zero, the function tests the object's state and returns immediately. If dwMilliseconds is INFINITE, the function's time-out interval never elapses.
Partager