Скачать ClipBoard Unit for BP7

15.09.1994
Скачать файл (14,24 Кб)

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.