Preventing Win Crash Messages



I decided to move the plug-in scanning module to a separate process (
It looks like it’s working fine. my problem now is that each time the scanning crashes I get the Windows message:
“PluginScanner has just stopped working…”

I did some searching and found that In addition to the try/catch I should also add this code:

#include <windows.h>


SetErrorMode(SetErrorMode(0) | SEM_NOGPFAULTERRORBOX);
//or if you only care about Vista or newer:
//SetErrorMode(GetErrorMode() | SEM_NOGPFAULTERRORBOX);

I’m using the JuceApplication class.

My question is: What is the best way to integrate those lines in my code?