Categories

CODE
Visual C++ Programming
C++ (Non Visual C++ Issues)
Modern Windows Apps (Metro)
C++ and WinAPI
Managed C++ and C++/CLI
Visual C++ Bugs & Fixes
Graphics Programming
Multithreading
Network Programming
Driver Development
Visual Basic 6.0 Programming
Visual Basic .NET
Crystal Reports
C-Sharp Programming
Managed C++
Visual Basic .NET
ASP.NET
.NET Framework
ADO.NET
Windows Presentation Foundation (WPF) & XAML forum
Silverlight
.NET Installation and Configuration Issues
Java Programming
AJAX
Scripting - Client Side
Database
XML
Wireless/Mobile Development
Assembly
Scripting - Server Side (PHP, Perl, etc.)
Python
General Developer Topics
Project Planning, Design, and Management
Testers and Testing
Algorithms & Data Structures
General Discussion / Chit Chat
Announcements, Press Releases, & News
Feedback
Articles Suggestions
Testing Area
Programming Projects
C# Game(s) Project
Game Engine Project
C++ Coding Project
Project: Code War
Slow Chat: Talk with Microsoft Developer Teams
Slow Chat: Developing Multithreaded Applications
Slow Chat: C++0x
Slow Chat: Visual C++: Yesterday, Today, and Tomorrow
Directory Services
General Windows and DNA Programming
Windows OS Issues
Open Positions (Jobs)
Looking for Work
Visual Basic .NET FAQs
Visual Basic FAQs
CodeGuru Individual FAQs
CodeGuru Individual Visual Basic FAQs

Resources

Java Database
Linux
Coding
Mobile
Hardware
Software Development
Software Development
iOS,OS X
iOS,OS X
ORACLE
IBM DEVELOPER
IBM DEVELOPER
MSDN
MSDN


Tags

C++ and WinAPI

Discuss Windows API related issues using C++ (and Visual C++). This is a non-MFC forum.

Detect unresponsive process?


Is there a smart way to detect if a certain process is unresponsive. For ex if it has crashed and the crash dialog is shown waiting for the user to push the send report buttons etc. Or if it's stuck in a forever loop, has locked itself or something like it.  				  			

  				  					Each condition you expressed represents very different 'sensory' logic.    If, for example, a dialog is showing some error condition, you could simply notify some 'protective service' that it's been shown. Some firewall and anti-virus applications run a separate 'service' application that can receive such a notice, and other period checks on it's brood.    The old 'tried and true' method is to see if the application is responding to messages, but it's no longer so 'true'. Back in the single thread days, if you sent a message to an application's main window and got no response, you'd know it's stuck. These days that could be a mistake - a thread might be locked but the UI thread still responds, so it's no longer as valuable a concept.    If you periodically check processor usage statistics and notice that your app is pegged at 100% utilization (gets complicated in multiple core systems), and that's not something you expect to happen for more than 'x' seconds, you can make some assumptions.    You'll notice that, occasionally, during shutdown (or application close), Windows may complain that an application isn't responding simply because it is taking too long to close. This is because they use a simple, not so universal means of determining that. It seems there are really no great solutions.    If you're in control of all the code you're attempting to control, you can incorporate heartbeats to check. The heartbeat is nothing more than some predictable action you can witness externally (could be implemented any number of ways, including, say, the setting of a semaphore - posting a message to the monitor service you're going to make for this - values written to shared memory established in a memory mapped file, etc).  				  			

  				  					Thanks for the informative reply. Your suggestions sounds worth investigating. I already have a service that monitors the process itself and restarts it when it's killed so I might try to play with that a bit and see if I can extend it to any of those things you mentioned.    Thank you again.


Related Links

Custom Icon
Resizing Client Rect vs Entire Window
Unique user session ID?
Deleting specific child from XMLDOMNodeListPtr?
Window Proecure problem
to create and use flexigrid using win32 api
Problem with CryptGetHashParam
StretchBlt doesnt work on Win98...help!
MAPI Profile ConfigureMsgService
SetLayeredWindowAttributes not recognized!
displaying a balloon tool tip
detect another application's dialog box
"open files" in computer management console
Handling a window
LDAP libraries
Loop each character