 <p>For those working with Windows API, there's a function which allows you to see if any debugger is present using:</p> <pre><code>if( IsDebuggerPresent() ) { ... } </code></pre> <p>Reference: <a href="http://msdn.microsoft.com/en-us/library/ms680345.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms680345.aspx</a></p>