Results 1 to 8 of 8

Thread: hiding progress window during file transfer

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2011
    Posts
    4

    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

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    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
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: hiding progress window during file transfer

    Why don't you just put a picturebox over it


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  4. #4
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: hiding progress window during file transfer

    Quote Originally Posted by jmsrickland View Post
    Why don't you just put a picturebox over it
    It's a popup dialog window from the O/S.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  5. #5
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    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.

  6. #6

  7. #7

    Thread Starter
    New Member
    Join Date
    Dec 2011
    Posts
    4

    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 View Post
    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

  8. #8
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    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.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width