Код: Выделить всё
while (GetMessage( lpMsg, hWnd, 0, 0)) ...
< /code>
документ говорит: < /p>
Возможность возвращаемого значения -1
означает, что такой код может привести к фатальным ошибкам приложения. Вместо этого используйте код
like: < /p>
< /blockquote>
BOOL bRet;
while( (bRet = GetMessage( &msg, hWnd, 0, 0 )) != 0)
{
if (bRet == -1)
{
// handle the error and possibly exit
}
else
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
Код: Выделить всё
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
Подробнее здесь: https://stackoverflow.com/questions/528 ... ssage-loop