炫彩作为mfc子窗口 接收WM_CHAR消息
大家如果把炫彩用到mfc上,会发现一个问题,炫彩没法收到WM_CHAR消息,其实这个比较简单
炫彩的XWnd_CreateEx 其实封装的是 CreateWindowEx 如果大家用这个创建mfc的子窗口,就没法接收到 WM_CHAR
消息,
怎么解决这个问题呢?其实很简单,
大家只需要在主窗口中,重载一下
BOOL CTestDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if (pMsg->message==WM_CHAR)
{
OutputDebugString("aaaaaaaaaaaaa\r\n");
return false;
}
return CDialog::PreTranslateMessage(pMsg);
}
只要return false即可
页:
[1]