SendMessageTimeout

This function sends a specified message to a window by calling the window procedure for the specified window, with the message as one of the parameters for the window procedure. If a specified window belongs to a different thread, SendMessageTimeout does not return until either the window procedure for that window processes the message or a specified time-out period elapses. If the window receiving the message belongs to the message queue of the current thread, SendMessageTimeout calls the window procedure directly and ignores the time-out value.

[in] Handle to the window to which SendMessageTimeout should send the message and for which SendMessageTimeout should call the window procedure. If the value of this parameter is HWND_BROADCAST, SendMessageTimeout sends the message to all top-level windows running on the operating system, including unavailable or hidden unowned windows. SendMessageTimeout does not return until each window times out. Therefore, the total delay can last up to uTimeout milliseconds times the number of top-level windows.

Msg

[in] Unsigned integer that specifies the message to be sent.

wParam

[in] WPARAM that specifies additional message-specific information.

lParam

[in] LPARAM that specifies additional message-specific information.

fuFlags

[in] Unsigned integer that specifies how to send the message. For Windows Embedded CE, the only valid value is SMTO_NORMAL, which indicates that the calling thread can process other requests while waiting for SendMessageTimeout to return.

uTimeout

[in] Unsigned integer that specifies the duration, in milliseconds, of the time-out period. If you send a broadcast message, each window can use the full time-out period. For example, if you specify a 5 second time-out period and three top-level windows fail to process the message, your total delay can last up to 15 seconds.

lpdwResult

[out] Pointer to a DWORD that receives the result of the message processing. This value depends on the message that you send.