PumpMessages 是做什么的?是一种什么机制?

解决方案 »

  1.   

    PumpMessages looks for the FD_xxx notification and the CSocket function will not return until the FD_xxx notification arrives. PumpMessages will not detect the socket notification if a timer is active because it looks for WM_TIMER messages first. When a WM_TIMER message arrives, the function doesn't look any further for other messages. The PumpMessages function is looking for WM_TIMER messages because it sets up its own timer to cause the application to retry its socket calls and do periodic idle-time processing while waiting for the socket notification. 
    see 
      

  2.   


    FIX: CSocket Operation Hangs if a Timer is Active
    Last reviewed: September 19, 1997
    Article ID: Q154649
      

  3.   

    PumpMessage()调用GetMessage()从消息队列中取一条消息,由于PumpMessage()是在消息队列中有消息的时候才被调用的,所以GetMessage()会马上返回