MFC消息完成消息反射

在OnCmdMsg之前调用ReflectLastMsg完成消息反射,

ReflectLastMsg->SendChildNotifyLastMsg(PS:此时使用CWnd对象调用的)->OnChildNotify->ReflectChildNotify

ReflectChildNotify中调用

case WM_COMMAND:
  {
   // reflect the message through the message map as OCM_COMMAND
   int nCode = HIWORD(wParam);
   if (CWnd::OnCmdMsg(0, MAKELONG(nCode, WM_REFLECT_BASE+WM_COMMAND), NULL, NULL))
   {
    if (pResult != NULL)
     *pResult = 1;
    return TRUE;
   }
  }

其中nCode是一个标识,0是单击,1是双击,2是setfocus

对于wm_notify消息来说是一样的路线,完毕···

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章