first You should get parent process id then terminate parent process as follows.
DWORD crtpid= GetCurrentProcessId();//get current process id before creating process
after creating process you may close parent process using their process id(crtpid)
HANDLE hProc = ::OpenProcess(PROCESS_ALL_ACCESS, FALSE, crtpid);
if (hProc)
{
::TerminateProcess(hProc, 1);
::CloseHandle(hProc);
}