Click to See Complete Forum and Search --> : copy files
GloriaYang
April 27th, 1999, 01:37 AM
Hello,
Does anybody know how to implement Copy files in our application,
and can be paste in Windows explorer ?
I mean that after copying files in your application ,you can selete munu item "paste" in Windows Explorer to paste the files in selected directory.
Thanks in advanced.
Best Regards
Gloria
Lothar Haensler
April 27th, 1999, 03:38 AM
you can use the SHFileOperation function to copy files. Set the wFunc member of the SHFILEOPSTRUCT structure to FO_COPY.
GloriaYang
April 27th, 1999, 05:16 AM
Thank you for your help.
But in SHFILESTRUCT ,member pTo still need to
identify the destination to copy files,but in
Windows Explorer, unless user click paste menu
item,we will have no idea where the destination
will be.
Lothar Haensler
April 27th, 1999, 06:17 AM
Ok, then, I thought it was a two-part question. One for copying files and the other...
Well, if you want to copy the filenames to the clipboard so that explorer "knows" how to paste it, you have to do it via the Clipboard.
You have to register a clipboard format using RegisterClipboardFormat and specify CFSTR_FILENAME as format identifier.
Read the details on MSDN "Clipboard Formats for Shell Data Transfers"
er_vineetb
May 12th, 2005, 02:36 AM
I had a similar problem, i try to copy a file in my application which support unicode.
I registered o format
UINT format = Registerclipboardformat(_T("FileName"))
and then i used this format for setting the data on clipboard
Setclipboarddata(format,hclipboarddata)
but it doesnot paste the entire file path(E:\test.txt) on clipboard, instead it pastes only first drive letter for eg E.
could you help me on this?
Regards
Vineet
cilu
May 12th, 2005, 02:51 AM
You can also use CopyFile.
er_vineetb
May 12th, 2005, 06:13 AM
CopyFile is a scripting function...can it be used in c++??
vineet
ovidiucucu
May 12th, 2005, 06:20 AM
CopyFile is a scripting function...can it be used in c++??
vineet
CopyFile would be a scripting function or not but there is one CopyFile (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcedata5/html/wce50lrfCopyFile.asp) also in Windows API.
Of course you can use it in C++.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.