这个函数功能超强,可是我不会使用.
  看了msdn还有有些迷迷糊糊.谁能给点详细解释(例程)?

解决方案 »

  1.   

    LRESULT SendMessage(
      HWND hWnd,      // handle to destination window
      UINT Msg,       // message
      WPARAM wParam,  // first message parameter
      LPARAM lParam   // second message parameter
    );向指定的窗体发送消息,并等待消息处理后返回。如果是同一线程窗体,等同于调用指定的窗体的 WindowProc。
      

  2.   

    好郁闷,这个 MSDN上都有……
      

  3.   

    使用CWnd::SendMessage
    #define WM_MYMESSAGE WM_USER + 5
    在类里
    afx_msg LRESULT OnMyMessage( LPARAM lParam,WPARAM wParam );
    消息映射中
    ON_MESSAGE( WM_MYMESSAGE, OnMyMessage )
    在想使用的地方
    SendMessage( WM_MYMESSAGE, lParam,wParam );
    可以用后面两个参数传递你要的数据。
      

  4.   

    LRESULT SendMessage(
      HWND hWnd,      // handle of destination window
      UINT Msg,       // message to send
      WPARAM wParam,  // first message parameter
      LPARAM lParam   // second message parameter
    );调用一个窗口的窗口函数,将一条消息发给那个窗口。除非消息处理完毕,否则该函数不会返回。
    返回值 
    Long,由具体的消息决定 
    参数表 
    参数 类型及说明 
    hwnd Long,要接收消息的那个窗口的句柄 
    wMsg Long,消息的标识符 
    wParam Long,具体取决于消息 
    lParam Any,具体取决于消息 
      

  5.   

    char c[100];
    ::SendMessage(GetDlgItem(EDIT_TEXT)->m_hWnd, 
    WM_GETTEXT, 100, (LPARAM)c);
    MessageBox(c);