Nou nou... dat kun je in de MSDN of PlatformSDK documentatie best zelf terugvinden... Volgens mijn exemplaar is het:
Return Values
If the function succeeds, the return value indicates the event that caused the function to return. This value can be one of the following.
Value Meaning
WAIT_ABANDONED The specified object is a mutex object that was not released by the thread that owned the mutex object before the owning thread terminated. Ownership of the mutex object is granted to the calling thread, and the mutex is set to nonsignaled.
WAIT_OBJECT_0 The state of the specified object is signaled.
WAIT_TIMEOUT The time-out interval elapsed, and the object's state is nonsignaled.
If the function fails, the return value is
WAIT_FAILED. To get extended error information, call GetLastError.
Oftewel... zodra de functie returned, en de return value is *niet* WAIT_TIMEOUT of WAIT_ABANDONED of WAIT_FAILED (bij single object wordt dat dus WAIT_OBJECT_0 als return value) is het wachten gelukt...
code:
1
2
3
4
5
6
7
8
| switch WaitForSingleObject(blabla)
{
case WAIT_OBJECT_0: { Gelukt(); break; }
case WAIT_TIMEOUT: { DuurtLang(); break; }
.
.
.
} |