| 151 | } |
| 152 | |
| 153 | bool GuiWaitFor(std::function<bool ()> pred) |
| 154 | { |
| 155 | while (!pred()) |
| 156 | { |
| 157 | MSG msg; |
| 158 | switch (GetMessage(&msg, nullptr, 0, 0 )) |
| 159 | { |
| 160 | case -1: Win32::ThrowLastError("GetMessage"); |
| 161 | case 0: return false; |
| 162 | } |
| 163 | |
| 164 | TranslateMessage(&msg); |
| 165 | DispatchMessage(&msg); |
| 166 | } |
| 167 | return true; |
| 168 | } |
| 169 | |
| 170 | } // namespace fusion |