想在里面设置一个变量的值
并用弹出窗口做测试
可是好像一直不能响应
为什么?void CMainFrame::OnLButtonDown(UINT nFlags, CPoint point) 
{
// TODO: Add your message handler code here and/or call default
m_bBtnDown = TRUE;
AfxMessageBox("mainframe leftbutton down"); CMDIFrameWnd::OnLButtonDown(nFlags, point);
}

解决方案 »

  1.   

    MainFrame只是一个框架,你必须点击应用程序的框架才会响应。而不是中间的空白区域
      

  2.   

    放到View中,要不试试在PreTranslateMessage中截获消息试试
      

  3.   

    看来只能使用 preTranslateMessage截获了to happyparrot 
     好像在框架中也是没有反应的啊
      

  4.   


    to happyparrot "好像要用OnNCLButtonDown吧"之前我想到过用这个
    不过在 class wizard 里面没有找到相应的消息可以让我添加这个函数
    :(
      

  5.   

    哦。可以的,你在classwizard界面的最后一个Tab页-class info页中,修改一下message filter就可以了。改成window就可以看到了。