Both of these things are completely untrue. I’ve written loads of .NET programs that do this kind of thing.
For C++, there are built in Windows APIs and guides written by Microsoft on how to use them to do this exact task of looping through running processes and getting info from them: Process Enumeration - Win32 apps | Microsoft Learn
Having said that, I agree with what others have said that this is not a reliable way to detect cheats at all