Hi,
You do one thing,perhaps you might been trying to stop chil process from parent one.Code like this may help you where pi is another process embedded in main process.
WaitForSingleObject( pi.hProcess, INFINITE );
dwErr=GetLastError();
DWORD dwExitCode;
BOOL bExitCode=GetExitCodeProcess(pi.hProcess,&dwExitCode);
// Close process and thread handles.
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
TerminateProcess(pi.hProcess,dwExitCode);