MCPcopy Create free account
hub / github.com/Aegel5/SimpleSwitcher / CliboardChanged

Method CliboardChanged

src/WorkerImplement.cpp:157–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157void WorkerImplement::CliboardChanged()
158{
159 LOG_ANY(L"ClipboardChangedInt");
160
161 if (!g_enabled.IsEnabled()) {
162 LOG_ANY(L"skip because disabled");
163 }
164
165 auto dwTime = GetTickCount64() - m_dwLastCtrlCReqvest;
166 bool isRecent = dwTime <= 500;
167
168 EClipRequest request = m_clipRequest;
169 m_clipRequest = CLRMY_NONE;
170
171 if (request != CLRMY_NONE) {
172 if (!isRecent) {
173 LOG_WARN(L"Request not recent");
174 }
175 else {
176 if (request == CLRMY_GET_FROM_CLIP) {
177 Worker()->PostMsg([](WorkerImplement* w) {w->GetClipStringCallback(); }, 20);
178 return;
179 }
180
181 if (request == CLRMY_hk_COPY) {
182 return;
183 }
184
185 return;
186 }
187 }
188
189
190 // --- This is user request ----
191
192 if (conf_get_unsafe()->fClipboardClearFormat) {
193 Worker()->PostMsg([](WorkerImplement* w) {w->ClipboardClearFormat2(); }, 500);
194 }
195
196 LOG_ANY(L"ClipboardChangedInt complete");
197}
198
199void WorkerImplement::ChangeForeground(HWND hwnd)
200{

Callers 1

StartMonitorMethod · 0.80

Calls 7

LOG_WARNFunction · 0.85
WorkerFunction · 0.85
conf_get_unsafeFunction · 0.85
GetClipStringCallbackMethod · 0.80
ClipboardClearFormat2Method · 0.80
IsEnabledMethod · 0.45
PostMsgMethod · 0.45

Tested by

no test coverage detected