I've seen some applications from which one can paste text into the
previously focused application.
Example: MSWord has previously been selected. When, for instance, a button
is pressed in my application I would like the previuosly focused application
(MSWord) to get focused and the contents that I have put onto the clipboard
to be pasted where the cursor is in the Word application.
How can I achieve this with C++Builder?
Thanks in advance.
/Håkan Andersson
if (Clipboard()->HasFormat(CF_TEXT))
{
QText->Clear () ;
AnsList->Clear () ;
StudentsAns->Clear () ;
QText->PasteFromClipboard () ;
}
else
ShowMessage ("No suitable data is on the Clipboard") ;
if (Clipboard()->HasFormat(CF_BITMAP))
{
Image->Picture->Bitmap->Assign(Clipboard ()) ;
}
else
if (Clipboard()->HasFormat(CF_PICTURE))
{
Image->Picture->Assign(Clipboard ()) ;
}
else
ShowMessage ("Nothing or incorrect data to paste") ;
Carry out a search for TClipboard in the help files