2 % Periodically clear the clipboard, e.g. to hide sensitive information
7 **ClearClipboard** is a simple tool that will *periodically clear* your clipboard. This is useful, for example, to hide sensitive information, such as passwords. The clear timeout can be configured freely and defaults to 30 seconds. Also, the clipboard will *not* simply be cleared at a fixed interval. Instead, the clear timer will be *reset* every time that new content is copied to the clipboard. This ensures that only "stale" content will be cleared; recently copied content will *never* be cleared away.
9 *Note:* The ClearClipboard program runs "hidden" in the background. However, there will be an icon in the [notification area](https://docs.microsoft.com/en-us/windows/desktop/uxguide/winenv-notification), which can be used to control or terminate ClearClipboard. Only one instance of ClearClipboard can be running at a time.
14 ClearClipboard runs on Windows Vista or newer. The "x64" version requires a 64-Bit version of Windows Vista or newer.
16 Windows XP is **not** supported, i.a., due to the lack of the `AddClipboardFormatListener` system function!
20 Windows 10 contains some "problematic" features that can put a risk on sensitive information copied to the clipboard:
22 * The first of those features is called [*Clipboard History*](https://www.tenforums.com/tutorials/109799-turn-off-clipboard-history-windows-10-a.html), which will silently keep a history (copy) of *all* data that has been copied to clipboard at some time. This history will persist even after the clipboard has been cleared!
24 * The second feature is called [*Automatic Syncing*](https://www.tenforums.com/tutorials/110048-enable-disable-clipboard-sync-across-devices-windows-10-a.html) (Cloud Clipboard), which will automatically upload *all* data that is copied to clipboard to the Microsoft cloud servers – purportedly to synchronize the clipboard between your devices!
26 We ***highly*** recommend to *disable* both of these features in order to keep your data safe and allow ClearClipboard to function as expected. To the best of our knowledge, the most reliable way to achieve this is to completely *disabled* the "Clipboard History" (`cbdhsvc`) system service. ClearClipboard will now detect whether the "problematic" service is running on your system, and if so, offer to disable that service. Note that a *reboot* will be required in order to make the changes take effect.
30 Optionally, you can *disable* the "Clipboard History" service with the following **`.reg`** file:
32 Windows Registry Editor Version 5.00
34 [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\cbdhsvc]
35 "Start"=dword:00000004
36 [HKEY_CURRENT_USER\Software\Microsoft\Clipboard]
37 "EnableClipboardHistory"=dword:00000000
40 Use this **`.reg`** file, if you ever whish to *re-enable* the "Clipboard History" service:
42 Windows Registry Editor Version 5.00
44 [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\cbdhsvc]
45 "Start"=dword:00000003
46 [HKEY_CURRENT_USER\Software\Microsoft\Clipboard]
47 "EnableClipboardHistory"=dword:00000001
49 As always, a reboot will be required in order to make the above registry "hacks" take effect!
52 # Command-line Options
54 The ClearClipboard program supports the following *mutually exclusive* command-line options:
57 Close the running instance of ClearClipboard, if ClearClipboard is currently running. Does nothing, otherwise.
60 Start a new instance of ClearClipboard. If ClearClipboard is already running, the running instance is closed.
63 Add "autorun" entry for ClearClipboard to the registry, so that ClearClipboard runs *automatically* at system startup.
66 Remove the "autorun" entry for ClearClipboard from the registry, if it currently exists. Does nothing, otherwise.
68 In addition, one or more of the following options may be appended to the command-line:
71 Suppress message boxes. Use, e.g., in combination with `--install` or `--uninstall` command.
74 Enable diagnostic output. You can use the [DebugView](https://docs.microsoft.com/en-us/sysinternals/downloads/debugview) tool from Sysinternals to show the generated messages.
77 Enable more verbose diagnostic output. Not normally recommended, as the system performance may be degraded.
80 Enable slunk mode for improved user experience. Check it out!
85 The behavior of the ClearClipboard program can be adjusted via a configuration file, in the [INI format](https://en.wikipedia.org/wiki/INI_file).
87 The configuration file must be located in the same directory as the ClearClipboard executable. Also, it must have the same file name as the ClearClipboard executable, except that the file extension is replaced by **`.ini`**. The default configuration file name therefore is **`ClearClipboard.ini`**. All parameters need to be located in the **`[ClearClipboard]`** section.
89 The following configuration parameters are supported:
91 * **`Timeout=<msec>`**
92 Specifies the timeout for automatic clipboard clearing, in milliseconds. Default: `30000`.
94 * **`TextOnly=<0|1>`**
95 If this parameter is set to `1`, ClearClipboard *only* clears the clipboard automatically, if it contains textual data. Otherwise, automatically clearing happens regardless of the current data format. Manual clearing is *not* effected. Default: `0`.
96 > Recognized textual formats include the *standard* text formats (`CF_TEXT`, `CF_OEMTEXT`, `CF_UNICODETEXT` and `CF_DSPTEXT`) as well as the most common "registered" formats for textual data. See [here](https://www.codeproject.com/Reference/1091137/Windows-Clipboard-Formats) for details.
99 Controls sound effects. Mode `1` plays a sound, when the clipboard is cleared manually. Mode `2` additionally plays a sound every time that the clipboard is cleared automatically. And mode `0` disables all sounds. Default: `1`.
100 > ClearClipboard uses the *"Empty Recycle Bin"* system sound, as set up in the control panel (`control mmsys.cpl`). If that sound file is *not* found or was set to "None", ClearClipboard will fall back to the "Asterisk" default sound.
102 * **`Hotkey=<key_id>`**
103 Specifies a system-wide hotkey (shortcut) to immediately clear the clipboard. The hotkey is specified as a three-digit *hexadecimal* number in the **`0xMNN`** format: `M` is the one-digit *modifier*, and `NN` is the two-digit *virtual-key code*. Allowed *modifiers* include Alt-key (`0x1`), Ctrl-key (`0x2`), Shift-key (`0x4`) and Win-key (`0x8`). Default: disabled.
104 > Multiple modifiers can be combined by adding up the corresponding numbers, in hexadecimal numeral system. The *virtual-key code* can be any one defined in the [Virtual-Key Codes](https://docs.microsoft.com/en-us/windows/desktop/inputdev/virtual-key-codes) table, except for codes smaller than `0x08`. For example, in order to use the combination »Alt+Ctrl+B« as your hotkey, you have to specify the value `0x342`. That is because the virtual-key code for »B« is `0x42`, and `0x1` (i.e Alt-key) plus `0x2` (i.e. Ctrl-key) makes `0x3`.
107 If this parameter is set to `1`, ClearClipboard starts in "halted" mode, i.e. with automatic clearing paused. Default: `0`.
109 * **`DisableWarningMessages=<0|1>`**
110 If this parameter is set to `1`, ClearClipboard will *not* warn about "problematic" Windows features or other programs that may expose your data to a risk. It is *not* recommended to do this, except for debugging purposes! Default: `0`.
112 * **`HideNotificationIcon=<0|1>`**
113 If this parameter is set to `1`, ClearClipboard will *not* create an icon in the notification area. The periodic clearing of the clipboard will work as usual, but the only way to exit ClearClipboard will be via the Task Manager. Default: `0`.
115 ## Example Configuration
117 An example configuration file:
127 # Updates & Source Code
129 Please check the official web-site at **<http://muldersoft.com/>** or **<http://muldersoft.sourceforge.net/>** for updates!
131 The source code of ClearClipboard is available from our public Git repository, mirrored at:
132 * `git clone https://github.com/lordmulder/ClearClipboard.git` ([Browse](https://github.com/lordmulder/ClearClipboard))
133 * `git clone https://muldersoft@bitbucket.org/muldersoft/clearclipboard.git` ([Browse](https://bitbucket.org/muldersoft/clearclipboard/))
134 * `git clone https://repo.or.cz/ClearClipboard.git` ([Browse](https://repo.or.cz/ClearClipboard.git))
139 ## Version 1.07 [2019-06-15] {-}
141 * Slightly improved detection of "textual" data on the clipboard.
143 * Implemented detection of "Ditto", a popular clipboard manager for Microsoft Windows.
145 * Some fixes and improvements.
147 ## Version 1.06 [2019-06-05] {-}
149 * Optional system-wide *hotkey* to immediately clear the clipboard. Use parameter `Hotkey` to configure.
151 * Allow more fine-grained control of diagnostic output.
153 * Some fixes and improvements.
155 ## Version 1.05 [2019-06-02] {-}
157 * Detect whether the Windows 10 "Clipboard History" service is running, and, if so, suggest to disable.
159 * Some fixes and improvements.
161 ## Version 1.04 [2019-06-01] {-}
163 * Optionally restrict the automatic clearing to *textual* data. Use parameter `TextOnly` to configure.
165 * Some fixes and improvements.
167 ## Version 1.03 [2019-05-31] {-}
169 * Clipboard can be cleared *manually* by double-click on the shell notification icon or from the context menu.
171 * Optionally, a sound file can be played whenever the clipboard is cleared.
173 * Automatic clipboard clearing can now be halted (suspended) or resumed at any time via the context menu.
175 * The additional configuration parameters `Sound` and `Halted` are supported now.
177 * Show message when "autorun" entry has been created or removed. Use option `--silent` to suppress.
179 * Detection of "problematic" Windows 10 features (*Clipboard History* and *Cloud Clipboard Sync*)
181 * Added "x64" (64-Bit) binaries of the ClearClipboard program. Note: Requires 64-Bit Windows edition to run.
183 * Some fixes and improvements.
185 ## Version 1.02 [2019-05-26] {-}
187 * Added shell notification icon that can be used to control the ClearClipboard program.
189 * Some fixes and improvements.
191 ## Version 1.01 [2019-05-25] {-}
193 * First public release.
198 **Copyright(Ⓒ) 2019 LoRd_MuldeR <mulder2@gmx.de>, released under the MIT License.**
200 Permission is hereby granted, free of charge, to any person obtaining a copy of this software
201 and associated documentation files (the "Software"), to deal in the Software without
202 restriction, including without limitation the rights to use, copy, modify, merge, publish,
203 distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
204 Software is furnished to do so, subject to the following conditions:
206 The above copyright notice and this permission notice shall be included in all copies or
207 substantial portions of the Software.
209 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
210 BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
211 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
212 DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
213 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
215 <https://opensource.org/licenses/MIT>