Chapter 25 The Clipboard

The clipboard is the main data-exchange feature of Microsoft Windows. It is a common area to store data handles through which applications can exchange formatted data. The clipboard holds any number of different data formats and corresponding data handles, all representing the same data, but in as many different formats as an application is willing to supply. For example, a pie chart might be held in the clipboard as both a metafile picture and a bitmap. An application pasting the pie chart would have to decide which representation it wanted. In general, the format that provides the most information is the most desirable, as long as the application understands that format.

This chapter covers the following topics:

Copying text to the clipboard

Pasting text from the clipboard

Pasting a bitmap from the clipboard

Using special clipboard features such as private data formats

This chapter also explains how to build a sample application, ClipText, that
illustrates many of the concepts explained in the chapter.