The information in this article applies to:
SYMPTOMSMessages sent to a UI thread through PostThreadMessage are lost if the messages are posted while the user is manipulating a window owned by the thread. Messages might be lost if they are sent while the user moves or resizes the window or if the window is a modal dialog box. CAUSEWhen an UI thread is involved in modal behavior, the thread pumps messages in a message loop internal to the modal system rather than in the thread's main message loop. Messages that are posted to a window can still be dispatched to the window procedure of the target window, because the messages are associated with a window. However, thread messages need to be handled directly by the message loop, because they cannot be automatically dispatched elsewhere. Since the secondary message loop does not know about the thread message, it will be dropped. RESOLUTION
Rather than using PostThreadMessage to post messages to a UI thread, use
PostMessage to post messages to a window owned by that thread. Since
messages directed to a window can be dispatched by a secondary message
loop, the messages is still handled properly, even when the thread is not
running in its primary message loop.
STATUSThis behavior is by design. Additional query words:
Keywords : kbNTOS kbWinOS2000 kbSDKWin32 kbGrpUser kbWinOS kbWndw kbWndwMsg |
Last Reviewed: February 1, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |