读书人

使用EndDialog关闭非模态对话框会不

发布时间: 2013-07-01 12:33:04 作者: rapoo

使用EndDialog关闭非模态对话框,会不会有问题?
使用EndDialog关闭非模态对话框,会不会有问题?

在前面create了一个对话框,后面关闭这个对话框的时候用的是EndDialog,这样用有问题吗?

是不是必须得用DestroyWindow呢?
[解决办法]
有问题哦, EndDialog 是只能用于模态对话框的.
[解决办法]
模态对话框有自己的消息循环
暂时阻断父窗口所在的消息循环.

[解决办法]
Remarks
The DestroyWindow function does not support the WM_PARENTNOTIFY message.

DestroyWindow destroys children of the specified window.

DestroyWindow does not flush the thread message queue.

Do not use DestroyWindow in one thread to destroy a window created by a different thread.

[解决办法]
post个自定义消息,消息响应函数去Destorywindow

读书人网 >C++

热点推荐