注意这句:
while WaitforSingleObject(ProcessInfo.hProcess, 10) = WAIT_TIMEOUT
你可以修改10这个值。
WaitforSingleObject参数:
Parameters
hHandle [in]
A 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]
The time-out interval, in milliseconds. If a nonzero value is specified, the function waits until the object is signaled or the interval elapses. If dwMilliseconds is zero, the function does not enter a wait state if the object is not signaled; it always returns immediately. If dwMilliseconds is INFINITE, the function will return only when the object is signaled.
Return Value
If the function succeeds, the return value indicates the event that caused the function to return. It can be one of the following values.