作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
假设我使用 CreateThread
创建一个线程,并且我想在该线程中有一个模态或非模态对话框。我是否需要像这里那样使用单独的消息循环,
while(GetMessage(&msg, 0, 0, 0)) // Get any window messages
{
TranslateMessage(&msg); // Translate the message
DispatchMessage(&msg); // Dispatch the message
}
但是对于模态对话框,您不使用它,所以为什么在我创建对话框时它不起作用?
最佳答案
当您使用模态对话框时,它会创建自己的消息队列,这就是它起作用的原因。如果你想使用无模式对话框,那么你必须自己创建一个消息队列。
来自 DialogBox
的文档:
The DialogBox macro uses the CreateWindowEx function to create the dialog box. (snip) and starts its own message loop to retrieve and dispatch messages for the dialog box.
关于c++ - 在新线程中创建对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7509593/
嘿。本周的一个教程,其中一个问题要求通过使用其他函数 formatLine 和 formatList 创建一个函数 formatLines,以格式化行列表。 我的代码是这样的; type Line =
我是一名优秀的程序员,十分优秀!