Suppressing exception dialogs

When creating an instance of FL Studio VSTi, I get the following message box (see attached pic).

This happens when the VST instance is created, directly after the call to the “main” function of the DLL (it seems to be a <2.4 plugin, otherwise it would have a “VSTPluginMain” entry instead of “main”). After closing the Message Box, the plugin works perfectly.
Now, when opening the same plugin with Ableton, there’s no such message box. Hence I believe that there’s a way to suppress it. But how?

You want SetUnhandledExceptionFilter:

Thanks for the suggestion, Vinn, but it doesn’t work (or I don’t know how to use it). Anyway, the exception filter doesn’t get called. I suppose that the DLL that gets loaded itself does some nasty stuff like setting its own exception filter (but for the DLL I tried API-hooking SetExceptionFilter API afterwards to some empty function, it still didn’t work).
There was another function I had found (AddVectoredExceptionHandler), which DID intercept the exception, but when I was returning EXCEPTION_CONTINUE_EXECUTION the app would just hang. I tried other stuff like SetExceptionFilter(NULL) in that function, but no results.