I set the flag - CREATE_NEW_CONSOLE
in the CreateProcess
attributes, but when debugging, the new console is not displayed. The task itself: Create a child process Child (add another console view of the project to the workspace, when creating a child process, take the new console to it).
int main(int argc, char *argv[], char *envp[]) { //Создание дочернего процесса STARTUPINFO si = { sizeof(si) }; SECURITY_ATTRIBUTES saProcess, saThread; PROCESS_INFORMATION piProcessB; TCHAR szPath[MAX_PATH]; lstrcpy(szPath, TEXT("Parents")); CreateProcess(NULL, szPath, &saProcess, &saThread, FALSE, NULL, NULL, NULL, &si, &piProcessB); saProcess.nLength = sizeof(saProcess); saProcess.lpSecurityDescriptor = NULL; saProcess.bInheritHandle = TRUE; saThread.nLength = sizeof(saThread); saThread.lpSecurityDescriptor = NULL; saThread.bInheritHandle = FALSE; lstrcpy(szPath, TEXT("Child")); CreateProcess(NULL, szPath, &saProcess, &saThread, FALSE, CREATE_NEW_CONSOLE, NULL, NULL, &si, &piProcessB); GetLastError(); getch(); }