zag2000, 使用WaitForSingleObject也是不对的。因为既然要通过ProcessMessage处理消息,<br>就必须经常性地轮询,如果使用WaitForSingleObject则会一直等待内核对象激活,没有一点<br>用处。必须换成MsgWaitForMultipleObjects<br><br>DWORD MsgWaitForMultipleObjects(<br> DWORD nCount, // number of handles in array<br> CONST HANDLE pHandles, // object-handle array<br> BOOL bWaitAll, // wait option<br> DWORD dwMilliseconds, // time-out interval<br> DWORD dwWakeMask // input-event type<br>);<br>在dwWakeMask中填入QS_ALLEVENTS即可。<br><br>