Example: Communicating with the Clipboard

The CBdemo program shows how to copy data between the active virtual buffer and the clipboard. CBdemo is very similar to the VBdemo program presented in the last section and uses the same top-level menu as VBdemo. The program's WM_CREATE handler creates a 320x200 virtual buffer and loads the PCX image MOUSE.PCX into the virtual buffer. Clicking the Cut item copies the contents of the virtual buffer to the clipboard, erases the image from the virtual buffer, and then displays the virtual buffer. This fills the client area with black (color 0) pixels. Clicking the Paste item copies the clipboard contents back to the virtual buffer and then displays the virtual buffer, making the original image appear once again in the client area.

C/C++ version

C++Builder version

Delphi version

Visual Basic version

<< Prev

Next >>

Contents
Fastgraph Home Page

 

copyright 2001 Ted Gruber Software, Inc.