F
freeia
Unregistered / Unconfirmed
GUEST, unregistred user!
void idle( DWORD dwTimeout,<br> DWORD dwTimeInterval = 1)<br>{<br> MSG msg;<br> DWORD dwTimeNext = GetTickCount() + dwTimeout;<br> // Wait time next.<br> while (GetTickCount() < dwTimeNext)<br> {<br> Sleep(dwTimeInterval);<br> if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))<br> {<br> TranslateMessage(&msg);<br> DispatchMessage(&msg);<br> }<br> }<br>}<br><br><br>在Delphi下面有对应的吗?<br>Sleep()API是不行的,会堵塞其它的消息处理.