The WaitForDebugEvent function waits for a debugging event to occur in a process being debugged.
BOOL WaitForDebugEvent(
LPDEBUG_EVENT lpDebugEvent, // pointer to debug event structure
DWORD dwMilliseconds // milliseconds to wait for event
);
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Only the thread that created the process being debugged can call WaitForDebugEvent.
Warning Do not queue an asynchronous procedure call (APC) to a thread that calls WaitForDebugEvent.
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in winbase.h.
Import Library: Use kernel32.lib.
Debugging Overview, Debugging Functions, ContinueDebugEvent, DebugActiveProcess, DebugBreak, DEBUG_EVENT, OutputDebugString