WIN32编程关于消息循环的一个有关问题

WIN32编程关于消息循环的一个问题
我写了一个简单的进制转换小程序。就是这个样子WIN32编程关于消息循环的一个有关问题

问题是:如果我在消息循环结尾处,手贱地加上了这行代码。WIN32编程关于消息循环的一个有关问题
上图的MESSAGEBOX呼出之后就点不动了,就是按钮都无法按动了,更别说消息了。也就是程序一直卡在MESSAGEBOX那儿没有返回,而窗口我设置模态,所以整个程序就卡着了。

当我取消这一行窗口默认消息后,MESSAGEBOX窗口的确定和取消按钮又可以按了,而且函数正常返回。

我想问问大神们,为什么DefWindowPro加上去之后MESSAGEBOX就卡着了??拜托了!!WIN32编程关于消息循环的一个有关问题(这是消息循环,当然,为了发帖我把默认消息处理函数写上了。进制转换函数看名字就很易懂,第二个按钮未编写。。。)
------解决思路----------------------
对话框的回调过程 DialogProc 和窗口的回调过程 WindowProc 是不一样的,对话框的内部有真正的窗口回调过程,这里面再调用对话框的回调过程。

微软的 MSDN 里面明确的说明了,在 DialogProc 中是不能调用 DefWindowProc 的,你非要去调用! 为什么会卡死只有微软能解释了,估计是这样破坏了鼠标点击这类消息的流动方向,让对话框内部的 WindowProc 没有机会处理消息,也就没法做出响应。

https://msdn.microsoft.com/en-us/library/windows/desktop/ms645469(v=vs.85).aspx

Remarks

You should use the dialog box procedure only if you use the dialog box class for the dialog box. This is the default class and is used when no explicit class is specified in the dialog box template. Although the dialog box procedure is similar to a window procedure, it must not call the DefWindowProc function to process unwanted messages. Unwanted messages are processed internally by the dialog box window procedure.