I'd like to copy some text to clipboard with this code:
TClipboard *Clipboard;
Clipboard = new TClipboard;
Clipboard->Open();
Clipboard->Clear();
AnsiString TextToClipboard;
TextToClipboard = "blablalba"; //here goes text to copy
Clipboard->AsText = TextToClipboard;
Clipboard->Close();
delete Clipboard;
works fine, but the problem is it does not copy all the characters like "c" (easteuropean characters), I get "è" in the clipboard instead.
I made a workaround through RichEdit:
RichEdit1->Lines->Add(TextToClipboard);
RichEdit1->SelectAll();
RichEdit1->CopyToClipboard();
but this is a bit ugly und untidy solution, can anyone help me to make it without RichEdit?
TClipboard *Clipboard;
Clipboard = new TClipboard;
Clipboard->Open();
Clipboard->Clear();
AnsiString TextToClipboard;
TextToClipboard = "blablalba"; //here goes text to copy
Clipboard->AsText = TextToClipboard;
Clipboard->Close();
delete Clipboard;
works fine, but the problem is it does not copy all the characters like "c" (easteuropean characters), I get "è" in the clipboard instead.
I made a workaround through RichEdit:
RichEdit1->Lines->Add(TextToClipboard);
RichEdit1->SelectAll();
RichEdit1->CopyToClipboard();
but this is a bit ugly und untidy solution, can anyone help me to make it without RichEdit?