MCPcopy Create free account
hub / github.com/OpenKneeboard/OpenKneeboard / ProcessControlMessage

Function ProcessControlMessage

src/injectables/WindowCaptureHook.cpp:159–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157}
158
159static bool ProcessControlMessage(
160 HWND hwnd,
161 unsigned int message,
162 WPARAM wParam,
163 LPARAM lParam) {
164 static UINT sControlMessage
165 = RegisterWindowMessageW(WindowCaptureControl::WindowMessageName);
166
167 if (message != sControlMessage) {
168 return false;
169 }
170
171 using WParam = WindowCaptureControl::WParam;
172 switch (static_cast<WParam>(wParam)) {
173 case WParam::Initialize:
174 gTopLevelWindow = reinterpret_cast<HWND>(lParam);
175 InstallDetours();
176 break;
177 case WParam::StartInjection:
178 gInjecting++;
179 gTopLevelWindow = reinterpret_cast<HWND>(lParam);
180 gLastSetForegroundWindow = gTopLevelWindow;
181 gLastInjectedAt = std::chrono::steady_clock::now();
182 InstallDetours();
183 break;
184 case WParam::EndInjection:
185 gInjecting--;
186 if (!gInjecting) {
187 gInjectedPoint = {};
188 gLastSetForegroundWindow = {};
189 }
190 break;
191 }
192
193 return true;
194}
195
196static bool
197ProcessMessage(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {

Callers 1

ProcessMessageFunction · 0.85

Calls 1

InstallDetoursFunction · 0.85

Tested by

no test coverage detected