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

Method ThreadMain

ExplorerHooks/taskviewvisibilitymonitor.cpp:97–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97void TaskViewVisibilityMonitor::ThreadMain() noexcept
98{
99 s_ThreadRunning = true;
100 const auto guard = wil::scope_exit([]() noexcept
101 {
102 s_ThreadRunning = false;
103 FAIL_FAST_IF_WIN32_BOOL_FALSE(SetEvent(s_ThreadCleanupEvent.get()));
104 });
105
106 const auto coInitialize = wil::CoInitializeEx_failfast(COINIT_APARTMENTTHREADED);
107 const auto viewService = LoadViewService();
108 const auto token = RegisterSink();
109
110 unique_window_failfast window(CreateWindowEx(WS_EX_NOREDIRECTIONBITMAP, reinterpret_cast<LPCWSTR>(s_WindowClassAtom.get()), TTBHOOK_TASKVIEWMONITOR.c_str(), 0, 0, 0, 0, 0, HWND_MESSAGE, nullptr, wil::GetModuleInstanceHandle(), nullptr));
111 FAIL_FAST_LAST_ERROR_IF_NULL(window);
112
113 BOOL ret;
114 MSG msg;
115 while ((ret = GetMessage(&msg, nullptr, 0, 0)) != 0)
116 {
117 FAIL_FAST_LAST_ERROR_IF(ret == -1);
118
119 TranslateMessage(&msg);
120 DispatchMessage(&msg);
121 }
122}
123
124DWORD WINAPI TaskViewVisibilityMonitor::ThreadProc(LPVOID) noexcept
125{

Callers

nothing calls this directly

Calls 2

getMethod · 0.80
c_strMethod · 0.80

Tested by

no test coverage detected