blob: 8fb2d243778b3867662be1eb7d1012841b8bbce6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#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;
}
}
|