WaitForSingleObject -тебе поможет.
Только без документации совсем плохо. Хочешь работать с Windows - придется читать MSDN.
MSDN :
Код:
WaitForSingleObject
The WaitForSingleObject function returns when one of the following occurs:
The specified object is in the signaled state.
The time-out interval elapses.
To enter an alertable wait state, use the WaitForSingleObjectEx function.
To wait for multiple objects, use the WaitForMultipleObjects.
DWORD WaitForSingleObject(
HANDLE hHandle,
DWORD dwMilliseconds
);
Parameters
hHandle
[in] Handle to the object. For a list of the object types whose handles can be specified,
see the following Remarks section.
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. For more information, see Standard Access Rights.
dwMilliseconds
[in] 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.
.......
The WaitForSingleObject function can wait for the following objects:
Change notification
Console input
Event
Job
Memory resource notification
Mutex
Process
Semaphore
Thread
Waitable timer