为什么 IsDialogMessage() 永远不会返回? [英] Why might IsDialogMessage() never return?

查看:40
本文介绍了为什么 IsDialogMessage() 永远不会返回?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在调试一个应用程序,该应用程序在其消息循环中调用 IsDialogMessage().有时, IsDialogMessage() 永远不会返回(其中 never 是大于 1 小时的间隔).根据 Microsoft 符号服务器提供的 user32.dll 符号,它似乎卡在 GetNextDlgGroupItem()(或相同的内部变体),迭代一些窗口.

I am debugging an application which, in its message loop, calls IsDialogMessage(). Occasionally, IsDialogMessage() never returns (where never is an interval greater than 1 hour). Based on the symbols for user32.dll available from Microsoft's symbol server, it appears to be stuck in GetNextDlgGroupItem() (or an internal variant of the same), iterating over some set of windows.

该应用程序是多线程的,并且经常接收外部事件的通知,这些通知作为 DCOM 调用到达.我怀疑这样的调用处理不当会破坏某些窗口状态.如果我能在 IsDialogMessage() 中了解哪种状态损坏可能导致无限循环,我想我将更容易识别损坏的来源.

The application is multithreaded and frequently receives notification of external events, which arrive as DCOM calls. I suspect that such a call is handled incorrectly in a way that corrupts some window state. If I can learn what sort of state corruption might cause an infinite loop in IsDialogMessage(), I think I will be more easily able to identify the source of the corruption.

推荐答案

您是否可能在不首先检查该控件是否具有焦点的情况下禁用控件(使用 ::EnableWindow())?如果是,则焦点会丢失并且 GetNextDlgGroupItem() 会混淆.

Are you maybe disabling controls (using ::EnableWindow()) without checking first whether that control has the focus? If yes, then the focus gets lost and GetNextDlgGroupItem() gets confused.

这篇关于为什么 IsDialogMessage() 永远不会返回?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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