An application is associated with a main thread that is running on an
operating system. A secondary thread monitors the main thread to
determine whether the application is in a hang state. A ghost window that
matches the hung application window is displayed on a user interface and
the hung application is hidden from view. An application crash is
attempted on the main thread when the user closes the ghost window. If
the crash is successful, any unsaved data associated with the hung
application is recovered. Error information associated with the cause of
the application hang may also be collected.