From 23580b17a055d4eafbfe8fa829f6c9f7352394c2 Mon Sep 17 00:00:00 2001 From: Aaron Hope Date: Thu, 29 Dec 2022 14:03:57 -0500 Subject: [PATCH] Add Microsoft's clipboard format for secrets Serving the same purpose as `Clipboard Viewer Ignore`, Microsoft defines `ExcludeClipboardContentFromMonitorProcessing`: > Place any data on the clipboard in this format to prevent all > clipboard formats being included in the clipboard history > or synchronized to the user's other devices. Per [Cloud Clipboard and Clipboard History Formats](https://learn.microsoft.com/en-us/windows/win32/dataxchg/clipboard-formats#cloud-clipboard-and-clipboard-history-formats) --- src/Clipboard.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Clipboard.cpp b/src/Clipboard.cpp index 51bd241..b091a6e 100644 --- a/src/Clipboard.cpp +++ b/src/Clipboard.cpp @@ -28,6 +28,8 @@ void Clipboard::makeSecret() const { if (_options.secret) { UINT CF_CLIPBOARD_VIEWER_IGNORE = RegisterClipboardFormat("Clipboard Viewer Ignore"); SetClipboardData(CF_CLIPBOARD_VIEWER_IGNORE, nullptr); + UINT CF_CLIPBOARD_MONITOR_EXLUDE = RegisterClipboardFormat("ExcludeClipboardContentFromMonitorProcessing"); + SetClipboardData(CF_CLIPBOARD_MONITOR_EXLUDE, nullptr); } }