zoukankan      html  css  js  c++  java
  • SendMessage

    LRESULT SendMessage
    ( HWND hWnd, // handle to destination window UINT Msg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter );

    Parameters

    hWnd [in]

    Type: HWND

    A handle to the window whose window procedure will receive the message. If this parameter is HWND_BROADCAST ((HWND)0xffff), 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.

    Message sending is subject to UIPI. The thread of a process can send messages only to message queues of threads in processes of lesser or equal integrity level.

    一个指向收到消息的窗口的句柄。

    Msg [in]

    Type: UINT

    The message to be sent.

    For lists of the system-provided messages, see System-Defined Messages.

    wParam [in]

    Type: WPARAM

    Additional message-specific information.

    lParam [in]

    Type: LPARAM

    Additional message-specific information.

    Return value

    Type:

    Type: LRESULT

    The return value specifies the result of the message processing; it depends on the message sent.

    返回值确定消息执行jieg,它依赖于被发送的消息。

    Remarks

    When a message is blocked by UIPI the last error, retrieved with GetLastError, is set to 5 (access denied).

    Applications that need to communicate using HWND_BROADCAST should use the RegisterWindowMessage function to obtain a unique message for inter-application communication.

    The system only does marshalling for system messages (those in the range 0 to (WM_USER-1)). To send other messages (those >= WM_USER) to another process, you must do custom marshalling.

    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. However, the sending thread will process incoming nonqueued messages while waiting for its message to be processed. To prevent this, use SendMessageTimeout with SMTO_BLOCK set. For more information on nonqueued messages, see Nonqueued Messages.

    An accessibility application can use SendMessage to send WM_APPCOMMAND messages to the shell to launch applications. This functionality is not guaranteed to work for other types of applications.

  • 相关阅读:
    二逼平衡树(树套树)
    NOI2010 超级钢琴
    SDOI2011 消耗战
    HNOI2013 游走
    [SDOI2010]外星千足虫
    [UVA 11374]Airport Express
    [Luogu P1354]房间最短路问题
    [Luogu P2296][NOIP 2014]寻找道路
    高精度算法
    洛谷红名+AC150祭
  • 原文地址:https://www.cnblogs.com/DeeLMind/p/6888996.html
Copyright © 2011-2022 走看看