eska
2012-07-06 19:38:22
Alright so I'm making a script for another game and I need to be able to read what is in the clipboard to modify the behavior of my script on the fly.
The clipboard is the place where your "Ctrl + C" save the text so that you can later paste it.
I found this thread and they show a a way to do it with an invisible form, but it is not working for me and I don't understand what isn't working:
http://villavu.com/forum/showthread.php?t=44203&highlight=clipboard
The suggested code:
So my question is, how can I get this to work? Thanks.
The clipboard is the place where your "Ctrl + C" save the text so that you can later paste it.
I found this thread and they show a a way to do it with an invisible form, but it is not working for me and I don't understand what isn't working:
http://villavu.com/forum/showthread.php?t=44203&highlight=clipboard
The suggested code:
program CopyPasta;
var
F: TForm;
E: TEdit;
procedure InitForm;
begin
F:= CreateForm;
E:= TEdit.Create(F);
with E do
begin
Parent:= F;
PasteFromClipboard;
Writeln(Text);
end;
end;
procedure SafeInitForm;
var
V: TVariantArray;
begin
V:= [];
ThreadSafeCall('InitForm', V);
end;
begin
SafeInitForm;
end.So my question is, how can I get this to work? Thanks.