const UINT MYWM_THISMSG = ::RegisterWindowMessage(_T("MYWN_MSG110")); ON_REGISTERED_MESSAGE(MYWM_THISMSG,OnMyProcess)但是::SendMessage(HWND_BROADCAST,MYWM_THISMSG,101,0);没反映,收不到::SendMessage(pMyServer->m_hWnd,MYWM_THISMSG,(int)101,0);就可以Why?

解决方案 »

  1.   

    你看看Sendmessage这个msdn的定义阿
      

  2.   

    我的是自定义类,派生自CWnd,在构造函数中Create什么是顶级窗口,怎么设置?
      

  3.   

    LRESULT SendMessage(
      HWND hWnd,      // handle of destination window
      UINT Msg,       // message to send
      WPARAM wParam,  // first message parameter
      LPARAM lParam   // second message parameter
    );
     
    Parameters
    hWnd 
    Handle to the window whose window procedure will receive the message. If this parameter is HWND_BROADCAST, the message is sent to all top-level windows in the system, including disabled or invisible unowned windows, overlapped windows, and pop-up windows; but the message is not sent to child windows. 
    注意:but the message is not sent to child windows. 
    不会发送到一个子窗口里去.
      

  4.   

    接收消息的类不但要派生自CWnd还要有CreateWindow