如对话框中有个cstatic控件,
如何拦截在cstatic控件上的WM_LBUTTONDOWN,以及其他的WM_XXX消息。
    ---先谢了!!

解决方案 »

  1.   

    重载Dialog的PreTranslateMessage函数
    BOOL CTestDlgDlg::PreTranslateMessage(MSG* pMsg) 
    {
    // TODO: Add your specialized code here and/or call the base class
    if(pMsg->message == WM_LBUTTONDOWN)
    {
    if(WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_STATIC1))
    {
    }
    }
    else if(pMsg->message == WM_LBUTTONUP)
    {
    if(WindowFromPoint(pMsg->pt) == GetDlgItem(IDC_STATIC1))
    {
    //AfxMessageBox("Hello");
    }
    }
    return CDialog::PreTranslateMessage(pMsg);
    }
      

  2.   

    多谢 papaya_stone(^_^)shentong(^_^) ,搞定了。