MCPcopy Create free account
hub / github.com/TranslucentTB/TranslucentTB / Run

Method Run

TranslucentTB/application.cpp:138–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138int Application::Run()
139{
140 while (true)
141 {
142 switch (MsgWaitForMultipleObjectsEx(0, nullptr, INFINITE, QS_ALLINPUT, MWMO_ALERTABLE | MWMO_INPUTAVAILABLE))
143 {
144 case WAIT_OBJECT_0:
145 for (MSG msg; PeekMessage(&msg, 0, 0, 0, PM_REMOVE);)
146 {
147 if (msg.message != WM_QUIT)
148 {
149 if (!m_AppWindow.PreTranslateMessage(msg))
150 {
151 TranslateMessage(&msg);
152 DispatchMessage(&msg);
153 }
154 }
155 else
156 {
157 return static_cast<int>(msg.wParam);
158 }
159 }
160 [[fallthrough]];
161 case WAIT_IO_COMPLETION:
162 continue;
163
164 case WAIT_FAILED:
165 LastErrorHandle(spdlog::level::critical, L"Failed to enter alertable wait state!");
166
167 default:
168 MessagePrint(spdlog::level::critical, L"MsgWaitForMultipleObjectsEx returned an unexpected value!");
169 }
170 }
171}
172
173winrt::fire_and_forget Application::Shutdown()
174{

Callers 1

wWinMainFunction · 0.80

Calls 1

PreTranslateMessageMethod · 0.45

Tested by

no test coverage detected