C++Language FeatureLearn C++

Easily Learn To Use The Clipboard In Modern C++ On Windows

Clipboard, also called as the paste buffer, is is a buffer which operating systems provide to copy things (texts, bitmaps, tables etc.) for short term and transfer within and between application programs. The clipboard is usually temporary and unnamed, and its contents reside in the computer’s memory.

In C++ Builder, you can use clipboard copy and paste event easily in VCL applications. There is a good example in here http://docwiki.embarcadero.com/CodeExamples/Sydney/en/FMX.CopyPaste_Sample

Let’s summarize some simple VCL and FMX copy and paste operations on texts and on bitmaps.

Using Clipboard in C++ Builder VCL Applications

In C++ Builder VCL applications you must include clipbrd.hpp

You can copy or paste Text by using clipboard() class as below,

You can copy or paste Bitmaps by using clipboard() class as below,

You can do more advanced things by using Clipboard(), There are many components using clipboard properties.

Using Clipboard in C++ Builder FireMonkey Applications

In C++ Builder FMX applications clipboard is available from IFMXClipboardService. There is FMX.clipboard.hpp header you can use.

In FireMonkey applications you need to use PlatformServices (TPlatformServices) to copy or paste things.

Copying Text to Clipboard

Copying Image to Clipboard

Paste Text from Clipboard

Copying Image to Clipboard

Find out more about using C++Builder for Windows Apps.

close

Oh hi there 👋
It’s nice to meet you.

Sign up to receive awesome C++ content in your inbox, every day.

We don’t spam! Read our privacy policy for more info.

About author

33+ years of coding with more than 30+ programming languages, mostly C++ on Windows, Android, Mac-OS, iOS, Linux and some other operating systems. Dr. Yilmaz Yoru was born in 1974, Eskisehir-Turkey. He graduated from the department of Mechanical Engineering of Eskisehir Osmangazi University in 1997. One year later he started to work in the same university as an assistant. He received his MSc and PhD degrees from the same department of the same university. He has married and he is a father of a son. Some of his interests are Programming, Thermodynamics, Fluid Mechanics and Artificial Intelligence. He also likes the graphical 2D & 3D design and high-end innovations.
Related posts
C++C++11C++14C++17Introduction to C++

Learn about Declaration of a Default Constructor Inside of Class Definition

Artificial Intelligence TechC++Learn C++

AI Tech :: Class Based Artificial Neuron Model in C++

Artificial Intelligence TechC++Learn C++

AI Techs :: Array Based Simple Artificial Neuron Model in C++

Artificial Intelligence TechC++Learn C++

AI Tech :: Structure Based Simple Artificial Neuron Model in C++

en_USEnglish