Detecting GPF in another process...
Ok. I have a program (not mine) that needs to run. It needs to run all the
Sometimes it crashes. Fine. I wrote a program that will call the second
program with CreateProcess, monitor it's existance with OpenProcess, and
restart it when necessary. Works great.
However, the second program will occasionally GPF with an access violation.
When this happens, OpenProcess still works fine, inducing my monitor program
to assume that everything is well, while the access violation dialog box
sits on the screen until someone hits the 'OK' button.
What I need to do is to detect when such a GPF happens in the second
application. So far, the only idea I have is to enumerate all of the
windows in the process, looking for one whose caption ends with 'Application
Error', and then enumerating for the 'OK' button and sending a WM_CLICK
message to it. Since this seems horribly kludgy, I'm wondering if there's a
better way that I'm missing.
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL