MCPcopy Create free account
hub / github.com/ClassicOldSong/Apollo / syncThreadDesktop

Function syncThreadDesktop

src/platform/windows/misc.cpp:251–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249 }
250
251 HDESK syncThreadDesktop() {
252 auto hDesk = OpenInputDesktop(DF_ALLOWOTHERACCOUNTHOOK, FALSE, GENERIC_ALL);
253 if (!hDesk) {
254 auto err = GetLastError();
255 BOOST_LOG(error) << "Failed to Open Input Desktop [0x"sv << util::hex(err).to_string_view() << ']';
256
257 return nullptr;
258 }
259
260 if (!SetThreadDesktop(hDesk)) {
261 auto err = GetLastError();
262 BOOST_LOG(error) << "Failed to sync desktop to thread [0x"sv << util::hex(err).to_string_view() << ']';
263 }
264
265 CloseDesktop(hDesk);
266
267 return hDesk;
268 }
269
270 void print_status(const std::string_view &prefix, HRESULT status) {
271 char err_string[1024];

Callers 5

send_inputFunction · 0.85
initMethod · 0.85
test_dxgi_duplicationFunction · 0.85
display_namesFunction · 0.85

Calls 2

hexFunction · 0.85
to_string_viewMethod · 0.80

Tested by 1

test_dxgi_duplicationFunction · 0.68