MSG uMsg; while (1) { if (PeekMessage(&uMsg, NULL, 0, 0, PM_NOREMOVE)) { TranslateMessage(&uMsg); DispatchMessage(&uMsg); }else{ Render(); } }