I create a process with this command
CreateProcess(target, NULL, NULL, NULL, FALSE, DEBUG_PROCESS, NULL, NULL, &si, &pi)
when I run this code with a special file , the process creates several threads, now I want to sure that all of that threads finished before I do something , I must use this function :
WaitForMultipleObjects( numThreads, // number of threads to wait for
threadHandles, // handles for threads to wait for
TRUE, // wait for all of the threads
INFINITE // wait forever
);
the second argument in this function is a array that contain handle of threads. now , how I get the handle of all threads that createprocess function create them