home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Plus! (NZ) 2001 June
/
HDC50.iso
/
Runimage
/
Delphi50
/
Doc
/
CLIPBRD.INT
< prev
next >
Wrap
Text File
|
1999-08-11
|
3KB
|
81 lines
{*******************************************************}
{ }
{ Borland Delphi Visual Component Library }
{ }
{ Copyright (c) 1995,99 Inprise Corporation }
{ }
{*******************************************************}
unit Clipbrd;
{$R-,T-,H+,X+}
interface
uses Windows, Messages, Classes, Graphics;
var
CF_PICTURE: Word;
CF_COMPONENT: Word;
{ TClipboard }
{ The clipboard object encapsulates the Windows clipboard.
Assign - Assigns the given object to the clipboard. If the object is
a TPicture or TGraphic desendent it will be placed on the clipboard
in the corresponding format (e.g. TBitmap will be placed on the
clipboard as a CF_BITMAP). Picture.Assign(Clipboard) and
Bitmap.Assign(Clipboard) are also supported to retrieve the contents
of the clipboard.
Clear - Clears the contents of the clipboard. This is done automatically
when the clipboard object adds data to the clipboard.
Close - Closes the clipboard if it is open. Open and close maintain a
count of the number of times the clipboard has been opened. It will
not actually close the clipboard until it has been closed the same
number of times it has been opened.
Open - Open the clipboard and prevents all other applications from changeing
the clipboard. This is call is not necessary if you are adding just one
item to the clipboard. If you need to add more than one format to
the clipboard, call Open. After all the formats have been added. Call
close.
HasFormat - Returns true if the given format is available on the clipboard.
GetAsHandle - Returns the data from the clipboard in a raw Windows handled
for the specified format. The handle is not owned by the application and
the data should be copied.
SetAsHandle - Places the handle on the clipboard in the given format. Once
a handle has been given to the clipboard it should *not* be deleted. It
will be deleted by the clipboard.
GetTextBuf - Retrieves
AsText - Allows placing and retrieving text from the clipboard. This property
is valid to retrieve if the CF_TEXT format is available.
FormatCount - The number of formats in the Formats array.
Formats - A list of all the formats available on the clipboard. }
type
TClipboard = class(TPersistent)
protected
procedure AssignTo(Dest: TPersistent); override;
public
procedure Assign(Source: TPersistent); override;
procedure Clear;
procedure Close;
function GetComponent(Owner, Parent: TComponent): TComponent;
function GetAsHandle(Format: Word): THandle;
function GetTextBuf(Buffer: PChar; BufSize: Integer): Integer;
function HasFormat(Format: Word): Boolean;
procedure Open;
procedure SetComponent(Component: TComponent);
procedure SetAsHandle(Format: Word; Value: THandle);
procedure SetTextBuf(Buffer: PChar);
property AsText: string;
property FormatCount: Integer;
property Formats[Index: Integer]: Word;
end;
function Clipboard: TClipboard;
function SetClipboard(NewClipboard: TClipboard): TClipboard;
implementation