A method and system are provided for managing application programs with
non-responsive user interfaces, possibly due to a bottleneck in handling
events/messages. The method and system make an apparently frozen
application user interface responsive so as to permit alternative tasks
be executed or close the hung application. This is enabled by
implementing routines to (a) detect if an application is hung, (b)
replace the user interface for the hung application with a ghost
interface, implemented by a separate thread, that permits system
functionality such as sizing, minimization and closing of the
application, and (c) destroying the ghost interface if the hung
application becomes responsive again along with restoring the
application's user interface along with updated event queues.
Furthermore, creation of the ghost user interface is accompanied by
placing a high priority special event in the hung application's queue to
detect renewed responsiveness without requiring explicit monitoring.