"Best practice is that all applications call the process-wide SetErrorMode function with a parameter of SEM_FAILCRITICALERRORS at startup. This is to prevent error mode dialogs from hanging the application."
(SEM_FAILCRITICALERRORS is a constant value 0x0001)
I would normally prefer to turn something like this off for a short a time as possible, but it is worth noting that the Microsoft documentation at http:// msdn.microsoft. com/en- us/library/ ms680621% 28VS.85% 29.aspx says
"Best practice is that all applications call the process-wide SetErrorMode function with a parameter of SEM_FAILCRITICA LERRORS at startup. This is to prevent error mode dialogs from hanging the application." ALERRORS is a constant value 0x0001)
(SEM_FAILCRITIC
That might be the simplest solution to implement.