GetErrorMode function (errhandlingapi.h)

Retrieves the error mode for the current process.

Syntax

UINT GetErrorMode();

Return value

The process error mode. This function returns one of the following values.

Return code/value Description
SEM_FAILCRITICALERRORS
0x0001
The system does not display the critical-error-handler message box. Instead, the system sends the error to the calling process.
SEM_NOALIGNMENTFAULTEXCEPT
0x0004
The system automatically fixes memory alignment faults and makes them invisible to the application. It does this for the calling process and any descendant processes. This feature is only supported by certain processor architectures. For more information, see SetErrorMode.
SEM_NOGPFAULTERRORBOX
0x0002
The system does not display the Windows Error Reporting dialog.
SEM_NOOPENFILEERRORBOX
0x8000
The system does not display a message box when it fails to find a file. Instead, the error is returned to the calling process.

Remarks

Each process has an associated error mode that indicates to the system how the application is going to respond to serious errors. A child process inherits the error mode of its parent process.

To change the error mode for the process, use the SetErrorMode function.

Windows 7:  Callers should favor SetThreadErrorMode over SetErrorMode since it is less disruptive to the normal behavior of the system. GetThreadErrorMode is the call function that corresponds to GetErrorMode.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header errhandlingapi.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See also

Error Handling Functions

Error Mode

GetThreadErrorMode

SetErrorMode