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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy File To Clipboard in BCB app?

Status
Not open for further replies.

Chris8852

Programmer
Jan 15, 2003
16
0
0
GB
Hello there, I'm programming an application that needs to copy a file onto the clipboard so the user can paste it in a folder of their choice. As far as I can tell the TClipboard won’t do that, and I've Ole implementation but its just one maze of code and structures after another... If anyone could please place some code to help me out on this I'd greatly appreciate it.
Thanks
 
Uhh, I wish it was that easy, but it's not. I need to copy a file itself onto the clipboard, not text, not an image, not raw data, but a file (e.x. C:\readme.txt), where the user can just press ctl-v and paste it someplace else.
I'm going to be astonished if no one knows how to do that!
 
Even that is easy, load the file into a memocomponent (LoadFromFile) or in a String object, and then use the member function CopyToClipboard Wim Vanherp
Wim.Vanherp@belgacom.net
 
The CopyToClipboard methods copy the contents of the file to the clipboard.
I think Chris wants to copy the file itself, like when you press ctrl-c in explorer.
 
Just hide the memo

When the initiating keypress or whatever
starts the process the memo is loaded and then the contents are copied to the clipboard. A cheat but it will do the deal nonetheless.
 
Yes hennep, hat I need it to do is copy the file onto the clipboard like when you press Ctrl-C in windows explorer, not copy the contents of the file whatsoever.
 
I believe when you copy a file (like from Explorer) to the windows clipboard the contents of the file are not dealt with at all- only the file name. When you decide to paste, then it initiates a copy (or move) process that deals with the contents of the file, but only then.
I need to be able to allow the user to simply paste the file I copy into any windows or 'explorer' folder, like he had copied it from another windows folder.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top