Hello to enumerate the processes I use the following function:
void ProcessClass::GetProcessList() { m_count = 0; HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); if (snapshot != INVALID_HANDLE_VALUE) { PROCESSENTRY32 process; process.dwSize = sizeof(PROCESSENTRY32); if (Process32First(snapshot, &process)) { do { m_count++; //printf("%d) PID: %d, Base Address: %x, Size: %x, Name: %s, CountThread: %d\n", count, process.th32ProcessID, process.dwSize, process.dwSize, process.szExeFile, process.cntThreads); } while (Process32Next(snapshot, &process)); } else { } } else { } CloseHandle(snapshot); return; } This function iterates the data and displays it. How to separate the output from busting and execute it in the program, not in the classroom. Because there are cases when you need to use console applications, window and everywhere output can be different, that is, in this class data is prepared and transmitted, and the program already decides what to do with this data