Unit ClipBrd
 ßßßßßßßßßßßß

The ClipBrd unit provides a clipboard for DOS and DPMI programs, which
is accessible in Windows' style. When your application is running in
a DOS box under Windows, Windows's clipboard functions are used.
If it is not, the functions are efficiently emulated.

So your programs can take part in dynamical data exchange (DDE), though
not being dependent on Windows.

 Unit ClipBrd: Functions and Procedures 
 Unit ClipBrd: Variables                
 Clipboard Format Constants             

 Using Windows' Clipboard               
 Clipboard Emulation                    
 Force Clipboard Emulation              

 Copyright                              

 Unit ClipBrd: Functions and Procedures
 ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß

 CloseClipboard      
 EmptyClipboard      
 ForceEmulation      
 GetClipboardData    
 GetClipboardDataSize
 OpenClipboard       
 SetClipboardData    

 See also:  Unit ClipBrd

 Unit ClipBrd: Variables
 ßßßßßßßßßßßßßßßßßßßßßßß

 var
   WinOldAp: Boolean;        READ ONLY

The main of the ClipBrd unit stores the result of the test whether running
inside a DOS box into this variable.

 See also:  Unit ClipBrd


 CloseClipboard         (Unit ClipBrd)
 ßßßßßßßßßßßßßß

 function CloseClipboard: Boolean;

This function closes the clipboard, such that other applications may
access it.

 Returns:  true if successful

In the emulating mode, CloseClipboard is without function. It always
returns TRUE.


 EmptyClipboard         (Unit ClipBrd)
 ßßßßßßßßßßßßßß

 function EmptyClipboard: Boolean;

This function empties the clipboard. Before calling EmptyClipboard,
the clipboard must be opened by OpenClipboard.

 Returns:  true if successful


 ForceEmulation         (Unit ClipBrd)
 ßßßßßßßßßßßßßß

 procedure ForceEmulation;

This procedure forces emulating the clipboard, i.e. it disables the
use of Windows' clipboard.


 GetClipboardData       (Unit ClipBrd)
 ßßßßßßßßßßßßßßßß

 function GetClipboardData(Format: Word; var Data): Boolean;

This function fills the buffer Data with a copy of the contents of
the clipboard in the specified format. Before calling GetClipboardData,
the clipboard must be opened by OpenClipboard.

 Returns:  true if successful

For the Format parameter, use the format constants cf_XXXX.


 GetClipboardDataSize   (Unit ClipBrd)
 ßßßßßßßßßßßßßßßßßßßß

 function GetClipboardDataSize(Format: Word): LongInt;

This function retrieves the size of the clipboard data in the specified
format.

 Returns:  Byte size of the data.

For the Format parameter, use the format constants cf_XXXX.


 OpenClipboard          (Unit ClipBrd)
 ßßßßßßßßßßßßß

 function OpenClipboard: Boolean;

This function opens the clipboard for the calling program, and locks it
for any other application.

 Returns:  true if successful

In the emulating mode, CloseClipboard is without function. It always
returns TRUE.


 SetClipboardData       (Unit ClipBrd)
 ßßßßßßßßßßßßßßßß

 function SetClipboardData(Format: Word; var Data; Size: LongInt): Boolean;

This function inserts data in the specified format into the clipboard.
Before calling SetClipboardData, the clipboard must be opened by
OpenClipboard. If there were alreeady data in this format, they are
replaced by the new data.

After the call, the memory block Data belongs to the clipboard. The
program may not access it any more.

 Returns:  true if successful

 Parameter  Description
 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
 Format     Data format (Constants cf_XXXX).
 Data       Memory block (on heap), representing the data
 Size       Byte size of the memory block.


 cf_XXXX: Clipboard Format Constants
 ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß

 Constant         Description
 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
 cf_Text          ANSI text (used by Windows applications). Each line is
                  ended by CR-LF, the text is ended by NUL.
 cf_Bitmap        Windows bitmap.
 cf_MetaFilePict  Windows metafile.
 cf_SYLK          MS Symbolic Link Format.
 cf_DIF           Software Arts' Data Interchange Format.
 cf_TIFF          Tag Image File Format.
 cf_OEMText       OEM text (used by DOS applications). Each line is
                  ended by CR-LF, der text is ended by NUL.
 cf_DIB           A memory block including a TBitmapInfo structure,
                  followed by bitmap data.
 cf_Palette       Windows palette.


 See also:  Unit ClipBrd


 Clipboard Emulation
 ßßßßßßßßßßßßßßßßßßß

When your application is running outside Windows, the clipboard functions
are emulated.

 * The main installs an ExitProc, freeing
   all clipboard data on exit.

 * OpenClipboard und CloseClipboard are
   without function because the clipboard
   is used by only one program.

 See also:  Unit ClipBrd


 Using Windows' Clipboard
 ßßßßßßßßßßßßßßßßßßßßßßßß

When your application is running inside a DOS box of Windows, Windows'
clipboard functions are used.

Since Windows rounds up the size of the memory blocks, the size returned
by GetClipboardDataSize needs not match this specified at a
SetClipboardData call.

Take care that you will dispose the whole block, and not only the memory
area used. That means, e.g. use FreeMem instead of StrDispose.

 See also:  Unit ClipBrd


 Copyright and
 Disclaimer of Warranty
 ßßßßßßßßßßßßßßßßßßßßßß

The files of the software product provided as a whole are called Software.

 Copyright

 The Software is neither "Public Domain",
 nor "Freeware". The Software is protected
 by the laws of the Federal Republic of
 Germany and international agreements.

 Copyright (C) 1993, 1994 Matthias K”ppe,
 Erzbergerstraáe 12, D-39104 Magdeburg.
 All rights reserved.

 Disclaimer of Warranty

 The Software is supplied as is. The authors
 disclaim all warranties, expressed or
 implied, including but not limited to the
 warranties of merchantability and of fitness
 for any purpose. The authors assume no
 liability for damages, direct or
 consequential, which may result from
 the use of the Software.

 General Agreement

 Using the Software, you agree to the general
 agreement, which is stated in the file
 SOFTWARE.DOC.

 If you have a copy of the Software that
 doesn't include this file, refer to:

 Matthias Koeppe
 MKM GbR f. Softwareentwicklung
 Erzbergerstraáe 12
 D-39104 Magdeburg
 GERMANY

 Phone/Fax  +49-391-5 43 01 28
 CIS        [100331,174]


    Source: geocities.com/~franzglaser/tpsrc

               ( geocities.com/~franzglaser)