PDA

View Full Version : Copy & Paste



DarknessX
22-05-2007, 12:11 AM
System: Windows XP
Compiler/IDE: Free Pascal
API: None

Ok, well, I need to implement copy & paste into my program... Now, the problems I have, is how would I:
a) always watch to see if person pressed Ctrl+v to paste?
b) read from the clipboard?

I don't need copy features, but I definitely need paste.

WILL
22-05-2007, 12:28 AM
What are you copying or pasting? Graphics, text?

DarknessX
22-05-2007, 01:17 AM
Text, its all text-based.

jdarling
22-05-2007, 01:01 PM
If your in Lazarus and not pure FPC then include the ClpBrd unit and use the methods and the Clipboard object defined within it. As for capturing the Ctrl+V, Ctrl+X and Ctrl+C events, use a global application TActionList.

If your in FPC, then look at the Lazarus ClpBrd unit, as it is VERY valuable. Then create a monitor process to look for your key-presses. When you find one, fire the appropriate handler.

DarknessX
22-05-2007, 07:29 PM
I'm in pure FPC... Hate lazarus. Well, thanks. I'll look for that unit.

WILL
22-05-2007, 08:21 PM
Clipboard seems to me like a WinAPI sort of thing. Though don't quote me on that. Maybe google for info on WinAPI to see if anything pops up there if the Lazarus unit doesn't work out for you.

DarknessX
22-05-2007, 11:00 PM
Thanks, that would be exactly what I need, cause I don't think I know enough OOP yet... I know how to make, initilize, use, and close objects, but thats all. I just need some practice :D

It takes me a while to learn a language (delphi/oop pascal being my second language now... Pascal as my first), but with Pascal, it took me around a year to make a functional app... then I went stir-crazy and non-stop practiced. :)