# Function Reference

# _WinAPI_WaitForSingleObject

Waits until the specified object is in the signaled state

#include <WinAPIProc.au3>
_WinAPI_WaitForSingleObject ( $hHandle [, $iTimeout = -1] )

## Parameters

$hHandle | A handle to the object
$iTimeout | [optional] The time-out interval, in milliseconds. If 0, the function tests the states of the specified objects and returns immediately. If -1, the function's time-out interval never elapses.

## Return Value

Success: | Indicates the event that caused the function to return
Failure: | (-1) WAIT_FAILED, call _WinAPI_GetLastError() to get extended error information

## Related

_WinAPI_WaitForMultipleObjects

## See Also

Search WaitForSingleObject in MSDN Library.