Jump to content
Sign in to follow this  
#ifdef

Clipboard history

Recommended Posts

Is there any way/API to get a clipboard history (Win + V)?

 

540131981_F180FAA4-22B2-4422-8FC4-3E323CFAE15C.png.a082b528641bc29a0c4349373eead063.png

Share this post


Link to post

AFAIK there's no such thing in Windows as a clipboard history.

 

Applications, and libraries (.NET, UWP, etc.), that offer a clipboard history does so by monitoring the clipboard and making local copies of the content when stuff is copied onto the clipboard.

This is why Windows' own clipboard history (WinKey+V) is always empty when you first invoke it. It needs to run in the background before it can collect data from the clipboard; Windows itself doesn't maintain a history.

 

This is also why it is very limited what data is stored in the clipboard history; The clipboard history application doesn't support a lot of formats (mostly text and bitmaps) and some data is only valid at the time when they were copied and require that the data source is live when the data is pasted.

 

You can use the drop target analyzer application from the Drag and Drop Component Suite to see the impact, in terms of requests made to the data source, of running the Windows clipboard history in the background. The drop source analyzer can be used to examine the difference between data copied directly from the clipboard and data that has been through the clipboard history.

Share this post


Link to post
1 hour ago, Anders Melander said:

This is why Windows' own clipboard history (WinKey+V) is always empty when you first invoke it

Not sure about this. It's empty when you first start windows. But as soon as you start using the clip board with any application Windows does maintain a history and WinKey+V does allow you to choose.

However I don't know a way of accessing these values programatically. But that doesn't mean there isn't a way.....

Share this post


Link to post
17 minutes ago, Roger Cigol said:

It's empty when you first start windows. But as soon as you start using the clip board with any application Windows does maintain a history

On my system (Windows 10) the history only contains data copied after first Win+V.

Win+V starts the "Clipboard User Service" (svchost.exe -k ClipboardSvcGroup -p). The service is set to manual start. Maybe it's set to auto start on your system?

 

Anyway, the history is not part of the clipboard system. It's just an application on top of it, no different from one that you could write yourself.
Trying to access the clipboard history data when there is no public API is IMO a waste of time when you can just replicate what it does. It's not that hard.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×