“程序没有响应"是什么意思? [英] What does « program is not responding » mean?

查看:44
本文介绍了“程序没有响应"是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此消息是什么意思,是否有 API 可以响应"Microsoft Windows 状态查询?

What does this message means, is there an API to « respond » to Microsoft Windows status queries ?

我正在寻找技术答案.谢谢:)

I'm looking for a technical answer. Thanks :)

推荐答案

这意味着程序无法为其消息队列提供服务.来自文档:

What this means is that the program is failing to service its message queue. From the documentation:

如果顶级窗口停止响应消息的时间超过几秒钟,系统会认为该窗口没有响应.在这种情况下,系统会隐藏窗口并用具有相同 Z 顺序、位置、大小和视觉属性的幻影窗口替换它.这允许用户移动它、调整它的大小,甚至关闭应用程序.但是,这些是唯一可用的操作,因为应用程序实际上没有响应.在调试器模式下,系统不会产生幻影窗口.

If a top-level window stops responding to messages for more than several seconds, the system considers the window to be 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 actually not responding. When in the debugger mode, the system does not generate a ghost window.

通常这意味着程序的主线程很忙,并且没有足够频繁地调用 GetMessage.长时间运行的任务应该在主 UI 线程以外的线程上执行.

Typically this means that the main thread of the program is busy and is not calling GetMessage frequently enough. Long running tasks should be performed on a thread other than the main UI thread.

这篇关于“程序没有响应"是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆