我的程序是Single docment类型的。1、为什么收不到呢?
2、要是想收到,要怎么办?

解决方案 »

  1.   

    可以受到的。在CLASSWIZARD中影射它就好了。
      

  2.   

    BOOL CMainFrame::PreTranslateMessage(MSG* pMsg) 
    {
    // TODO: Add your specialized code here and/or call the base class
    if(pMsg->message == WM_KEYDOWN)
    MessageBox("hello");
    return CFrameWnd::PreTranslateMessage(pMsg);
    }
      

  3.   

    不行的,是不是被CView接收了?
      

  4.   

    BOOL CMainFrame::PreTranslateMessage(MSG* pMsg) 
    {
    // TODO: Add your specialized code here and/or call the base class
    if(pMsg->message==WM_KEYDOWN)
    {
    if(pMsg->wParam==VK_RETURN)//响应回车
         MessageBox("enter");
                      ..
    }
    return 1;
    }
      

  5.   

    因为cview覆盖了MainFrame,所以收不到这些消息,就比如你在MainFrame中设置了图标可是没有效果一样,因为被cview覆盖了。