命令消息与通知消息,如何界定呀?都是产生 WM_COMMAND 消息呀?
---------------------------------------------------------
好像菜单的就是:命令消息.
控件的就是:通知消息,
但是,按钮的单击,却又是"命令消息"我有点晕了,到底 命令消息 与 通知消息,如何界定呢?

解决方案 »

  1.   

    MSDN得到
    This message is sent when the user selects a command item from a menu, when a control sends a message to its parent window, or when an accelerator keystroke is translated. WM_COMMAND wNotifyCode = HIWORD(wParam); 
      wID = LOWORD(wParam); 
      hwndCtl = (HWND) lParam;
    Parameters
    wNotifyCode 
    Value of the high-order word of wParam. Specifies the notification code if the message is from a control. If the message is from an accelerator, this parameter is 1. If the message is from a menu, this parameter is 0. 
    wID 
    Value of the low-order word of wParam. Specifies the identifier of the menu item, control, or accelerator. 
    hwndCtl 
    Handle to the control sending the message if the message is from a control. Otherwise, this parameter is NULL. 
      

  2.   

    http://www.yesky.com/SoftChannel/72342371928702976/20031119/1746313_2.shtml
      

  3.   

    命令消息一般就认为是菜单和工具栏的响应,MFC的对其消息的路由,跟通知稍有不同的,通知消息还牵扯到MFC中的消息反射。