views:

145

answers:

2

Is it possible to intercept WIN32 exceptions for 3rd party applications?

I have a particularly bad behaving 3rd party application for which I'm try to intercept unhandled exceptions so I can know that I need to kill the process but I'm finding it hard to find anything about this subject that seems to fit what I need.

Any help would be appreciated.

-Thanks.

A: 

You can use ADPlus to intercept unhandled Win32 exceptions and notify you via Windows messenger service. However, as commented, if the misbehaving application keeps running after the exception is thrown, it means the exception is actually caught and handled, and ADPlus won't be that useful.

eran
+1  A: 

If the exceptions are truly unhandled, you can use CreateRemoteThread and SetUnhandledExceptionFilter.

If not (i.e. the program does not actually crash), you could write a simple debugger and intercept all exceptions, whether handled or not.

zildjohn01