How to detect if your application is running under the IDE

By: mykle hoban

Abstract: This article describes how to detect if your application was launched by the IDE or as a standalone.

Question

How do I detect if my application is running in the IDE?

Answer

Use the IsDebuggerPresent() WinAPI call.
Example:


if (IsDebuggerPresent()) Label1->Caption = "debug"; else Label1->Caption = "no debug";


Server Response from: ETNASC03