Board index » cppbuilder » Checking Clipboard contents...

Checking Clipboard contents...

How do I see if there is text on the clipboard when my application loads...I
couldn't seem to find an appropriate function call when looking in help.

Thanks,
Beebs

 

Re:Checking Clipboard contents...


Use the TClipboard::HasFormat() method:

    #include <ClipBrd.hpp>

    if( Clipboard()->HasFormat(CF_TEXT) )
        // do something

Gambit

Quote
"Beebs" <ABieber...@2tacweb.com> wrote in message

news:3db6e5c1$3@newsgroups.borland.com...
Quote
> How do I see if there is text on the clipboard when
> my application loads...

Re:Checking Clipboard contents...


Quote
>     if( Clipboard()->HasFormat(CF_TEXT) )

what happend here when the clipboard contains binary files like .mp3 or a
.doc file ?

Oren

Re:Checking Clipboard contents...


HasFormat indicates if the Clipboard object contains a particular format.

procedure HasFormat(Format: Word): Boolean;

Description

Use HasFormat to find out if the information on the clipboard is encoded
using a specific format. If HasFormat is True, the format is present; if
False, the format is absent. The Clipboard object keeps a list of available
formats in the Formats array property.
Some of the possible values of the Format parameter follow. There are many
more Clipboard formats provided by Windows or other Windows applications.
Custom formats can be registered also. All are supported by HasFormat.

Value Meaning

CF_TEXT Text with each line ending with a CR-LF combination. A null
character identifies the end of the text.
CF_BITMAP A Windows bitmap graphic.
CF_METAFILEPICT A Windows metafile graphic.
CF_PICTURE An object of type TPicture.
CF_OBJECT Any persistent object.

--
Yours,

Slartibardfast & Zephod Beeblebrox

(Team Zip)

Re:Checking Clipboard contents...


HasFormat() simply returns false.

Gambit

Quote
"Oren (Halvani.de)" <neroni...@gmx.de> wrote in message

news:3db6efc4@newsgroups.borland.com...
Quote
> what happend here when the clipboard contains binary files
> like .mp3 or a .doc file ?

Other Threads