Hi,

I am automating a program by calling Windows API functions and subs. From time to time, the program that is being automated crashes and the '... has stopped working' dialog box appears with two options:

a) Check online for a solution and close the program
b) Close the program

I already have another way to monitor the program to make sure that it is not hanged, but this dialog box that handles unhandled executions is a nuisance. I found a way to disable this (http://msdn.microsoft.com/en-us/library/bb513638.aspx)

I think the code would probably use SetUnhandledExceptionFilter and UnhandledExceptionFilter but not sure how to implement it any further. Any thoughts?

Declare PtrSafe Function UnhandledExceptionFilter Lib "kernel32" Alias "UnhandledExceptionFilter" (ExceptionInfo As EXCEPTION_POINTERS) As Long
Declare PtrSafe Function SetUnhandledExceptionFilter Lib "kernel32" Alias "SetUnhandledExceptionFilter" (ByVal lpTopLevelExceptionFilter As LongPtr) As LongPtr
Thanks.

abousetta