如何让窗口无效(包括menu和toolbar)??
高人指点指点,谢谢了

解决方案 »

  1.   

    在PreTranslateMessage(MSG* pMsg)把响应消息过滤掉
      

  2.   

    ON_UPDATE_COMMAND_UI处理这些消息
      

  3.   

    这样试试
    ::AfxGetMainWnd()->EnableWindow(FALSE);
      

  4.   

    你应该PreTranslateMessage(MSG* pMsg)把响应消息过滤掉,还要综合EnableWindow(FALSE)等几方面的因素考虑
      

  5.   

    除了使用PreTranslateMessage()
    还可以使用UPDATE_COMMAND_UI   
    OnUpdateYouId(   CCmdUI*   pCmdUI   )   
    {   
      pCmdUI->Enable(   false   );   
    }   
      

  6.   

    按钮窗口等无效EnableWindow(0)
    菜单 工具栏按钮无效 使用UPDATE_COMMAND_UI   
    OnUpdateYouId(   CCmdUI*   pCmdUI   )   
    {   
      pCmdUI->Enable(   false   );   
    }
      

  7.   

    过滤掉   
      BOOL   CWizardBaseDlg::PreTranslateMessage(MSG*   pMsg)     
      {   
      //   TODO:   Add   your   specialized   code   here   and/or   call   the       base   class   
          if   ((pMsg->message   ==   WM_KEYDOWN&&pMsg->wParam   ==   VK_RETURN))//使对话框不响应   VK_RETURN   
      {   
      return   false;   
      }   
      return   CDialog::PreTranslateMessage(pMsg);   
      }
      

  8.   

    支持这个
    ===========
    过滤掉   
      BOOL   CWizardBaseDlg::PreTranslateMessage(MSG*   pMsg)     
      {   
      //   TODO:   Add   your   specialized   code   here   and/or   call   the       base   class   
          if   ((pMsg->message   ==   WM_KEYDOWN&&pMsg->wParam   ==   VK_RETURN))//使对话框不响应   VK_RETURN   
      {   
      return   false;   
      }   
      return   CDialog::PreTranslateMessage(pMsg);   
      }