| 244 | } |
| 245 | |
| 246 | static bool ProcessEventLoop() { |
| 247 | MSG msg; |
| 248 | |
| 249 | while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { |
| 250 | if (msg.message == WM_QUIT) { |
| 251 | return false; |
| 252 | } |
| 253 | |
| 254 | if (!TranslateAccelerator(msg.hwnd, haccelTable, &msg)) { |
| 255 | TranslateMessage(&msg); |
| 256 | DispatchMessage(&msg); |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | return true; |
| 261 | } |
| 262 | |
| 263 | static bool RunFrameInstance(int elapsedMsec) { |
| 264 | if (!ProcessEventLoop()) { |