MFC消息完成消息反射

来源:互联网 发布:华为软件外包 编辑:程序博客网 时间:2024/05/01 06:04

在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消息来说是一样的路线,完毕···

原创粉丝点击