The information in this article applies to:
SUMMARYSendMessageTimeout() is new to the Win32 application programming interface (API). The function sends a message to a window and does not return until either the window procedure processes the message or the timeout occurs. MORE INFORMATION
This article uses the following scenario to illustrate the behavior of this
function:
If Win1 executes this SendMessageTimeout() and Win2 uses SendMessage() to
send a message to Win1, Win1 can process the message because SMTO_NORMAL
was specified. If the SendMessageTimeout() expires while the execution is
currently in the window procedure for Win1, the state of the system will
depend on who owns the windows.
If both windows were created by the same thread, the timeout is not used and the process proceeds exactly as if SendMessage() was being used. If the windows are owned by different threads, the results can be unpredictable, because the timeout is restarted whenever a message or some other system event is received and processed. In other words, the receipt by Win1 of WM_USER+2 causes the timeout to restart after the message is processed. If the function executed by Win2, OtherStuff(), then uses up more than 100 milliseconds without awakening the thread that created Win1, the original SendMessageTimeout() will timeout and return. The OtherStuff() function continues to completion but any value that was to be returned to Win1 will be lost. Note that the code paths will always complete. Additional query words:
Keywords : kbNTOS350 kbNTOS351 kbNTOS400 kbWinOS2000 kbSDKWin32 kbGrpUser kbWinOS95 kbWinOS98 kbWndw kbWndwMsg |
Last Reviewed: February 2, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |