void DoEvents() { MSG msg; // Process existing messages in the application‘s message queue. // When the queue is empty, do clean up and return. while (::PeekMessage(&msg,NULL,0,0,PM_NOREMOVE)) { if (!AfxGetThread()->PumpMessage()) return; } } void Delay(DWORD time) { DWORD t=::GetTickCount(); while(::GetTickCount() -t < time) { DoEvents(); } }
时间: 2024-10-08 15:23:26