DWORD dwStart = GetTickCount();
DWORD dwEnd = dwStart;
do
{
MSG msg;
GetMessage(&msg,NULL,0,0);
// or PeekMessage(&msg,NULL,0,0,PM_REMOVE);
TranslateMessage(&msg);
DispatchMessage(&msg);
dwEnd = GetTickCount()-dwStart;
}while(dwEnd <50);
转载于:https://www.cnblogs.com/nemolog/archive/2005/11/07/270687.html