Archived
1
0
This repository has been archived on 2024-10-17. You can view files and clone it, but cannot push or open issues or pull requests.
winamp/Src/Plugins/Input/in_cdda/util.cpp

23 lines
430 B
C++
Raw Normal View History

2024-09-24 12:54:57 +00:00
#include "Main.h"
void WaitForEvent(HANDLE hEvent, DWORD msMaxWaitTime)
{
// DWORD i;
MSG msg;
const unsigned long eachWait = 10;
unsigned long totalWait = 0;
while (WaitForSingleObject(hEvent, eachWait) == WAIT_TIMEOUT)
{
while (PeekMessage(&msg, (HWND) NULL, 0, 0, PM_REMOVE))
{
//TranslateMessage(&msg);
DispatchMessage(&msg);
}
totalWait += eachWait;
if (totalWait >= msMaxWaitTime)
break;
}
}