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消息來說是一樣的路線,完畢···

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