Click to See Complete Forum and Search --> : Is it possible to access explorer UI for copying files ?


Amn
April 29th, 2003, 04:22 AM
We know and seen there is copying of files implemented in Windows Explorer - it copies files, or directories, a window pops up with "Copying files..." and some papers fly from here to there, along with a progress bar indicating operation status.

I wonder if we can access and program this interface in our programs, if we can make such a dialog popup and copy files for ourselves without mimicing it, but relying on already provided interface. In other words, is that interface some kind of public API ?

Thanks in advance !

the_ENIGMA
April 29th, 2003, 06:40 AM
why can't a win32 "CopyFile" be used for this stuff ?
i believe itz not the dialog box with flying papers that is
copying the file data, its this routine thtz doing the copy process

Mike Harnad
April 29th, 2003, 07:02 AM
Windows Explorer uses the Windows Shell to accomplish file handling. You can use it too by using the Shell API. For example, you can use SHFileOperation() to perform the function you've asked about.

Amn
April 29th, 2003, 07:42 AM
the_Enigma: Thanks for reply. Yes currently i am using CopyFile and it silently but perfectly copies the file. Yes i am aware that it is not UI but a thread that copies the file.

Mike: Thanks, that was very valuable information ;) ! Indeed, it can be used for my purpose...

P.S. By the way, why can't compiler find definition for CopyFileEx when i included <windows.h> like required ?!?!?!?

Amn

the_ENIGMA
April 29th, 2003, 07:56 AM
i guess this routine is only for 2K / NT 4.0 & later

_WIN32_WINNT in winbase.h
looks for a version above or equal to 4.0..

rsmemphis
April 29th, 2003, 08:29 AM
In fact, the window you refer to has two controls:
One avi that animates the paper flying, and one progressbar.

I am rather sure you would have to implement those yourself. I know there is a program that can extract resources from an exe file (such as the avi animation), but then you run into copyright issues.

Amn
April 29th, 2003, 08:53 AM
the_Enigma: well, in winbase.h it says _WINNT_WIN32 >= 0x400 (NT 4.0), but MSDN clearly states "Windows 98 or higher). Which one is right then ? :)

rsmemphis: Thanks for advice. Yes i could do that and get some good results, but i am not going for mimicing, i need a dynamic solution. Yes, now its a paper flying but in some years, there will be other stuff, and my app will look like a bad copy painting ;) What i am saying is, it is not important how my dialog looks like, important thing was whether i can spare time and space by avoiding to reinvent the wheel, when Explorer does it ;)

Amn
April 29th, 2003, 08:56 AM
SHFileOperation does the job perfectly ! :D

Thanks Mike, and others ! What would one do without the Code Gurues ....

the_ENIGMA
April 30th, 2003, 07:55 AM
Originally posted by Amn
the_Enigma: well, in winbase.h it says _WINNT_WIN32 >= 0x400 (NT 4.0), but MSDN clearly states "Windows 98 or higher). Which one is right then ? :)



well.. go by the basics...
don't by the documentations... there are many
things tht MSDN conceals from you & me... :)