Hello, I have a following problem. My app starts an external app (code is shown below), and waits for it to finish. That's OK but sometimes this external app launches *its* child app and terminates itself. How can I determine if this "child-app" (launched by external app) had finished execution? Particularly, I launch a deinstaller but this deinstaller launches a main deinstaller and terminates - my program doesn't wait for the main deinstaller to finish - I'd like to know if it's possible.
ANY help would be greatly appreciated, as I've searched the net for a solution and found nothing
My sample code for launching external app looks like this:
STARTUPINFO StartInfo;
PROCESS_INFORMATION ProcInfo;
memset(&ProcInfo, 0, sizeof(ProcInfo));
memset(&StartInfo, 0 , sizeof(StartInfo));
StartInfo.cb = sizeof(StartInfo);
if (FileExists(deinstaller.c_str())==true)
{
int res = CreateProcess(deinstaller.c_str(), params.c_str(), NULL, NULL, NULL, NULL, NULL, NULL, &StartInfo, &ProcInfo);
if (res)
{
WaitForSingleObject(ProcInfo.hThread, INFINITE);
CloseHandle(ProcInfo.hProcess);
}
}
ANY help would be greatly appreciated, as I've searched the net for a solution and found nothing
My sample code for launching external app looks like this:
STARTUPINFO StartInfo;
PROCESS_INFORMATION ProcInfo;
memset(&ProcInfo, 0, sizeof(ProcInfo));
memset(&StartInfo, 0 , sizeof(StartInfo));
StartInfo.cb = sizeof(StartInfo);
if (FileExists(deinstaller.c_str())==true)
{
int res = CreateProcess(deinstaller.c_str(), params.c_str(), NULL, NULL, NULL, NULL, NULL, NULL, &StartInfo, &ProcInfo);
if (res)
{
WaitForSingleObject(ProcInfo.hThread, INFINITE);
CloseHandle(ProcInfo.hProcess);
}
}