请各们大侠给我详细介绍SendMessage函数的用法。谢谢
句柄如何引用,  比如HICON,HWND

解决方案 »

  1.   


      Platform SDK: Windows User Interface 
    SendMessage
    The SendMessage function sends the specified message to a window or windows. It calls the window procedure for the specified window and does not return until the window procedure has processed the message. To send a message and return immediately, use the SendMessageCallback or SendNotifyMessage function. To post a message to a thread's message queue and return immediately, use the PostMessage or PostThreadMessage function. LRESULT SendMessage(
      HWND hWnd,      // handle to destination window
      UINT Msg,       // message
      WPARAM wParam,  // first message parameter
      LPARAM lParam   // second message parameter
    );
    Parameters
    hWnd 
    [in] 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. 
    Msg 
    [in] Specifies the message to be sent. 
    wParam 
    [in] Specifies additional message-specific information. 
    lParam 
    [in] Specifies additional message-specific information. 
    Return Values
    The return value specifies the result of the message processing; it depends on the message sent. Res
    Applications that need to communicate using HWND_BROADCAST should use the RegisterWindowMessage function to obtain a unique message for inter-application communication.If the specified window was created by the calling thread, the window procedure is called immediately as a subroutine. If the specified window was created by a different thread, the system switches to that thread and calls the appropriate window procedure. Messages sent between threads are processed only when the receiving thread executes message retrieval code. The sending thread is blocked until the receiving thread processes the message. Requirements 
      Windows NT/2000: Requires Windows NT 3.1 or later.
      Windows 95/98: Requires Windows 95 or later.
      Header: Declared in Winuser.h; include Windows.h.
      Library: Use User32.lib.
      Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.See Also
    Messages and Message Queues Overview, Message and Message Queue Functions, InSendMessage, PostMessage, PostThreadMessage, RegisterWindowMessage SendDlgItemMessage, SendMessageCallback, SendNotifyMessage Built on Thursday, May 11, 2000Requirements 
      Windows NT/2000: Requires Windows NT 3.1 or later.
      Windows 95/98: Requires Windows 95 or later.
      Header: Declared in Winuser.h; include Windows.h.
      Library: Use User32.lib.
      Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.
    See Also
    Messages and Message Queues Overview, Message and Message Queue Functions, InSendMessage, PostMessage, PostThreadMessage, RegisterWindowMessage SendDlgItemMessage, SendMessageCallback, SendNotifyMessage 
      

  2.   

    我也想知道,有没有高手总结一下呀;)
    不过好像有高人总结过MFC消息事件的参数等信息,
    http://www.csdn.net/expert/topic/758/759000.xml?temp=.3059046
    看看这个吧:)