How to determine at runtime when a C ++ application is connected to a visual studio debugger?

How do you determine at runtime whether the visual studio debugger is connected to your process. I saw instructions on how to do this in .NET, but my process is its own C ++ process. Support for detecting timely debugging would be nice, but not a strict requirement.

+5
source share
2 answers

The sound of Win32 IsDebuggerPresent()sounds as if it should work.

+13
source