hiding progress window during file transfer
I have some older visual basic programs I wrote that run every hour to transfer files between folders.
I just bought a new laptop with Windows 8. The VB programs work fine (compiled into EXE)
But occasionally when the copy operation of a file is delayed or lags in Windows, the mini progress window appears in the foreground (preparing to copy, x% complete).
This is annoying while I'm trying to work on my laptop.
On this thread, you can see a screenshot of what this progress windows looks like (similar not exact)
http://stackoverflow.com/questions/1...ess-dialog-api
To copy files, I'm using
FileCopy oldfile, newfile
I also can use
bSuccess = ShellFileCopy(oldfile, newfile)
Is there any attribute I can set with either of these commands, to disable or minimize the progresss mini window during file transfers?
Alternately, is there another command or shell extention I can try, that does allow me to disable or minimize the progresss mini window during file transfers?
Thanks
Re: hiding progress window during file transfer
That ShellFileCopy function (if it is what I think it is, uses the SHFileOperation API. Well that API's SHFILEOPSTRUCT has several flags that can be set to copy/move/delete files silently.
Click on the links for more details
Re: hiding progress window during file transfer
Why don't you just put a picturebox over it
Re: hiding progress window during file transfer
Quote:
Originally Posted by
jmsrickland
Why don't you just put a picturebox over it
It's a popup dialog window from the O/S.
Re: hiding progress window during file transfer
FileCopy is probably just a thin wrapper on CopyFileA in Kernel32, and I see nothing helpful there.
Calling SHFileOperationA or SHFileOperationW in Shell32 might work if you set FOF_NO_UI (a group of flag bits). What the heck is your ShellFileCopy doing?
Oops! Too slow.
Re: hiding progress window during file transfer
Re: hiding progress window during file transfer
Thanks, I followed your links and noticed the FOF_SILENT flag in the
SHFILEOPSTRUCT structure.
This is a bit over my head. How do I set the FOF_SILENT flag from the shellfilecopy command I'm using below.
bSuccess = ShellFileCopy(oldfile, newfile)
Or perhaps I need some extra code. Thanks
Quote:
Originally Posted by
LaVolpe
That ShellFileCopy function (if it is what I think it is, uses the
SHFileOperation API. Well that API's
SHFILEOPSTRUCT has several flags that can be set to copy/move/delete files silently.
Click on the links for more details
Re: hiding progress window during file transfer
Problem is that we don't know the code your ShellFileCopy function has in it. I am making a bold assumption it is copied & pasted from this link? If so, you notice that the lFlags variable is assigned to the WinType_SFO variable's .fFlag member? That lFlags variable needs to contain all the options you want. You load up the options by OR'ing the option values together. The sample code was wrong when it tried to combine them using the ampersand (&) as in this line on that link:
Code:
If NoConfirm Then lflags = lflags & FOF_NOCONFIRMATION
Should've been more like
Code:
If NoConfirm Then lflags = lflags Or FOF_NOCONFIRMATION
Someone posted the values of those Constants towards bottom of the page in that SHIFILEOPSTRUCT link I provided.
Last but not least. You said this over your head a bit. Can't stress enough: don't use code you don't understand. Learn and understand what it is doing and why it was used. Blindly using OPC (other people's code) will burn you and ultimately could lessen credibility you earned otherwise. You've been forewarned.