IsDebuggerPresent Function
IsDebuggerPresent Function

Determines whether the calling process is being debugged by a user-mode debugger.

Syntax

C++
BOOL WINAPI IsDebuggerPresent(void);

Parameters

This function has no parameters.

Return Value

If the current process is running in the context of a debugger, the return value is nonzero.

If the current process is not running in the context of a debugger, the return value is zero.

Remarks

This function allows an application to determine whether or not it is being debugged, so that it can modify its behavior. For example, an application could provide additional information using the OutputDebugString function if it is being debugged.

To determine whether a remote process is being debugged, use the CheckRemoteDebuggerPresent function.

To compile an application that uses this function, define the _WIN32_WINNT macro as 0x0400 or later. For more information, see Using the Windows Headers.

Requirements

Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll

See Also

CheckRemoteDebuggerPresent
Debugging Functions
OutputDebugString

Send comments about this topic to Microsoft

Build date: 7/30/2009

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
vb.net syntax      dmex   |   Edit   |   Show History
<DllImport("kernel32.dll", CharSet:=CharSet.Auto, ExactSpelling:=True)> _
Public Shared Function IsDebuggerPresent() As Boolean
End Function
Tags What's this?: Add a tag
Flag as ContentBug
C# syntax      dmex ... Mirosław   |   Edit   |   Show History
[DllImport("kernel32.dll", CharSet=CharSet.Auto, ExactSpelling=true)]
internal static extern bool IsDebuggerPresent();
Tags What's this?: Add a tag
Flag as ContentBug
Processing
Page view tracker