16,551
社区成员
发帖
与我相关
我的任务
分享
::EnableWindow( AfxGetApp()->m_pMainWnd->m_hWnd, true );
::PostMessage( AfxGetApp()->m_pMainWnd->m_hWnd, MY_MESSAGE, 0, 0 );
BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
{
if( MY_MESSAGE == pMsg->message )
{
TRACE( "MainFrame Received MY_MESSAGE message...\n" );
}
return CFrameWnd::PreTranslateMessage(pMsg);
}
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
...
SetTimer( 1, 1000, NULL );
...
...
}
void CMainFrame::OnTimer(UINT nIDEvent)
{
SendMessage( MY_MESSAGE, 0, 0 );
CFrameWnd::OnTimer(nIDEvent);
}
BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
{
TRACE( "message loop...\n" );
return CFrameWnd::PreTranslateMessage(pMsg);
}
当我弹出非模式对话框时,也没有TRACE输出。