返回首页

MFC,按"Xquot;或"关闭它应该发送一个WM_CLOSE消息:??|您好
我有一个简单的MFC应用程序,当我按下"X"或"关闭??应该发送WM_CLOSE消息,我试图赶上它在我的PreTranslateMessage(味精* PMSG),但它dosent来。我应该怎么办赶上WM_CLOSE消息?
提前感谢
M.H


BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)

{

	TRACE("\n MSG %d", pMsg->message);

	if(pMsg->message == WM_CLOSE)

		MessageBox("WM_CLOSE");

	else if(pMsg->message == WM_QUIT)

		MessageBox("WM_QUIT");

	else if(pMsg->message == WM_DESTROY )

		MessageBox("WM_DESTROY");

    return __super::PreTranslateMessage(pMsg); // allow default behavior

}

回答

评论会员: 时间:2