// 等待发送给本线程的消息, 收到不通的消息分别作不同的处理
dwResult=::MsgWaitForMultipleObjects(0,0,false,20,QS_POSTMESSAGE );
if (dwResult == WAIT_OBJECT_0)
{
if(PeekMessage(
&Msg, // address of structure with message
NULL, // retrieve messages posted to this thread
0, 0, // do not perform any message filtering
PM_REMOVE ) ) // message is removed from the queue
{
if ( Msg.message==WM_SENDCMGS )
{ .........
}
}