Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to detect content of Clipboard?

Status
Not open for further replies.

hstijnen

Programmer
Nov 13, 2002
172
NL
Hi,

Is it possible to detect the format of the data in the windows clipboard? I want to intercept the ctrl-V (Paste) in order to different processing of text, table, figure,... etc.

Any suggestions?

Henk
 
Look at the TClipBoard component.

James P. Cottingham
-----------------------------------------
To determine how long it will take to write and debug a program, take your best estimate, multiply that by two, add one, and convert to the next higher units.
 
Read about Clipboard() and HasFormat() in Builder's help. Here's a simple example:

Unit1.h
Code:
[COLOR=green]#include <Clipbrd.hpp>[/color]

Unit1.cpp
Code:
[b]void __fastcall[/b] TForm1::Button1Click(TObject *Sender)
{
  [b]if[/b](Clipboard()->HasFormat(CF_TEXT))
  {
    Label1->Caption = "There's text in the clipboard.";
  }
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top