@@ -368,14 +368,21 @@ int CClip::LoadFromClipboard(CClipTypes* pClipTypes, bool checkClipboardIgnore,
368368 return FALSE ;
369369 }
370370
371+ // https://learn.microsoft.com/en-us/windows/win32/dataxchg/clipboard-formats
372+ if (::IsClipboardFormatAvailable (theApp.m_excludeClipboardContentFromMonitorProcessing ))
373+ {
374+ Log (_T (" ExcludeClipboardContentFromMonitorProcessing type is on the clipboard, skipping this clipboard change" ));
375+ return FALSE ;
376+ }
377+
371378 // If we are saving a multi paste then delay us connecting to the clipboard
372379 // to allow the ctrl-v to do a paste
373380 if (::IsClipboardFormatAvailable (theApp.m_cfDelaySavingData ))
374381 {
375382 Log (_T (" Delay clipboard type is on the clipboard, delaying 1500 ms to allow ctrl-v to work" ));
376383 Sleep (1500 );
377384 }
378-
385+
379386 // Attach to the clipboard
380387 if (!oleData.AttachClipboard ())
381388 {
@@ -385,8 +392,36 @@ int CClip::LoadFromClipboard(CClipTypes* pClipTypes, bool checkClipboardIgnore,
385392 }
386393
387394 oleData.EnsureClipboardObject ();
388-
389-
395+
396+ // https://learn.microsoft.com/en-us/windows/win32/dataxchg/clipboard-formats
397+ if (oleData.IsDataAvailable (theApp.m_canIncludeInClipboardHistory ))
398+ {
399+ HGLOBAL includeInHistory = oleData.GetGlobalData (theApp.m_canIncludeInClipboardHistory );
400+ if (includeInHistory != nullptr )
401+ {
402+ bool doReturn = false ;
403+
404+ DWORD* data = static_cast <DWORD*>(GlobalLock (includeInHistory));
405+ if (data != nullptr )
406+ {
407+ if (*data == 0 )
408+ {
409+ Log (_T (" CanIncludeInClipboardHistory is 0, skipping this clipboard change" ));
410+ doReturn = true ;
411+ }
412+
413+ GlobalUnlock (includeInHistory);
414+ }
415+
416+ GlobalFree (includeInHistory);
417+ if (doReturn)
418+ {
419+ oleData.Release ();
420+ return FALSE ;
421+ }
422+ }
423+ }
424+
390425 m_Desc = " [Ditto Error] BAD DESCRIPTION" ;
391426
392427 // Get Description String
0 commit comments