What does “program not responding” mean?

What does this message mean, is there an API to respond to requests for Microsoft Windows status?

I am looking for a technical answer. Thanks:)

+2
source share
2 answers

This means that the program does not maintain a message queue. From the doc:

If the top-level window stops responding for more than a few seconds, the system considers that the window is not responding. In this case, the system hides the window and replaces it with a ghost window that has the same Z-order, location, size, and visual attributes. This allows the user to move it, resize it, or even close the application. However, these are the only actions available because the application is not really responding. When in debug mode, the system does not generate a ghost window.

This usually means that the main thread of the program is busy and does not call GetMessage often enough. Long tasks must be performed in a thread other than the main user interface thread.

+4
source

Windows applications interact with the operating system to receive Windows messages. These messages are processed by the application in it by the main thread in the loop.

If the application cannot process its messages on time (a few seconds is the field), the message queue is filled, and windows mark this application as "not responding", making it the main window white and such.

This behavior is mainly caused by a lengthy operation in the same thread that processes Windows messages. This thread is often referred to as the "main user interface thread." If you are not doing explicit multithreading, this may be the only thread in your application.

+2
source

Source: https://habr.com/ru/post/1237221/


All Articles